From a8722e1ec423a77c9983a50c9747341325aa468c Mon Sep 17 00:00:00 2001 From: Andrey Date: Wed, 25 Sep 2024 12:04:16 +0200 Subject: [PATCH] failing spec shows that test duration are set to 0 if Timecop.mock_process_clock is set to tru --- spec/datadog/ci/contrib/timecop/instrumentation_spec.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/spec/datadog/ci/contrib/timecop/instrumentation_spec.rb b/spec/datadog/ci/contrib/timecop/instrumentation_spec.rb index 7a525477..bbcbf55b 100644 --- a/spec/datadog/ci/contrib/timecop/instrumentation_spec.rb +++ b/spec/datadog/ci/contrib/timecop/instrumentation_spec.rb @@ -13,6 +13,7 @@ Minitest::Runnable.reset Timecop.freeze(time_1990) + Timecop.mock_process_clock = true class SomeTest < Minitest::Test def test_pass @@ -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