Commit 8d96062f authored by Lin Jen-Shin's avatar Lin Jen-Shin

Make sure the algorithm did exclude gaps

parent defd8899
...@@ -126,7 +126,7 @@ describe Ci::Pipeline, models: true do ...@@ -126,7 +126,7 @@ describe Ci::Pipeline, models: true do
let(:current) { Time.now.change(usec: 0) } let(:current) { Time.now.change(usec: 0) }
let(:build) { create_build('build1', current, 10) } let(:build) { create_build('build1', current, 10) }
let(:build_b) { create_build('build2', current, 20) } let(:build_b) { create_build('build2', current, 20) }
let(:build_c) { create_build('build3', current + 40, 20) } let(:build_c) { create_build('build3', current + 50, 10) }
describe '#duration and #pending_duration' do describe '#duration and #pending_duration' do
before do before do
...@@ -156,7 +156,7 @@ describe Ci::Pipeline, models: true do ...@@ -156,7 +156,7 @@ describe Ci::Pipeline, models: true do
pipeline.reload pipeline.reload
expect(pipeline.duration).to eq(40) expect(pipeline.duration).to eq(40)
expect(pipeline.pending_duration).to eq(35) expect(pipeline.pending_duration).to eq(25)
end end
end end
......
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