Commit c7fdcbb9 authored by Avielle Wolfe's avatar Avielle Wolfe

Make test duration more stable

Using `2.hours.ago - 1.hour.ago` gives a value that is slightly off from
3600 seconds (and also is a negative number - not a duration). `1.hour`
is more stable and simple to understand
parent ed46eacb
......@@ -345,7 +345,7 @@ RSpec.describe Gitlab::Ci::Pipeline::Chain::Command do
describe '#observe_step_duration' do
it 'adds the duration to the step duration histogram' do
histogram = double(:histogram)
duration = 2.hours.ago - 1.hour.ago
duration = 1.hour
expect(histogram).to receive(:observe).with({}, duration.seconds)
expect(::Gitlab::Ci::Pipeline::Metrics).to receive(:pipeline_creation_step_duration_histogram)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment