Skip to content

Commit

Permalink
failing spec shows that test duration are set to 0 if Timecop.mock_pr…
Browse files Browse the repository at this point in the history
…ocess_clock is set to tru
  • Loading branch information
anmarchenko committed Oct 17, 2024
1 parent fc40f77 commit a8722e1
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions spec/datadog/ci/contrib/timecop/instrumentation_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
Minitest::Runnable.reset

Timecop.freeze(time_1990)
Timecop.mock_process_clock = true

class SomeTest < Minitest::Test
def test_pass
Expand All @@ -25,6 +26,9 @@ def test_pass

it "does not set frozen time when setting start time for traces" do
expect(first_test_span.start_time).not_to eq(time_1990)
expect(first_test_span.duration).not_to eq(0)

expect(test_session_span.start_time).not_to eq(time_1990)
expect(test_session_span.duration).not_to eq(0)
end
end

0 comments on commit a8722e1

Please sign in to comment.