Commit 74e39274 authored by James Lopez's avatar James Lopez

Merge branch 'fix/transient-failing-analytics-spec' into 'master'

Fix transient failure on AnalyticsBuildEntity

AnalyticsBuildEntity uses `Time.now` to calculate durations, and on slow running builds could fail this spec. Mocking with `Timecop` should be sufficient to fix this.

Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/25500

See merge request !8082
parents 19435b9a 5ac78a23
...@@ -13,6 +13,14 @@ describe AnalyticsBuildEntity do ...@@ -13,6 +13,14 @@ describe AnalyticsBuildEntity do
subject { entity.as_json } subject { entity.as_json }
before do
Timecop.freeze
end
after do
Timecop.return
end
it 'contains the URL' do it 'contains the URL' do
expect(subject).to include(:url) expect(subject).to include(:url)
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