Skip to content

Commit 13cd936

Browse files
committed
⏰👮🏻
1 parent f5e132b commit 13cd936

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

sentry-ruby/spec/sentry/rack/capture_exceptions_spec.rb

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -686,14 +686,16 @@ def will_be_sampled_by_sdk
686686
end
687687

688688
it "subtracts puma.request_body_wait" do
689-
timestamp = Time.now.to_f - 0.1 # 100ms ago
690-
env["HTTP_X_REQUEST_START"] = "t=#{timestamp}"
691-
env["puma.request_body_wait"] = 40 # 40ms waiting for client
689+
Timecop.freeze do
690+
timestamp = Time.now.to_f - 0.1 # 100ms ago
691+
env["HTTP_X_REQUEST_START"] = "t=#{timestamp}"
692+
env["puma.request_body_wait"] = 40 # 40ms waiting for client
692693

693-
stack.call(env)
694+
stack.call(env)
694695

695-
queue_time = transaction.contexts.dig(:trace, :data, 'http.queue_time_ms')
696-
expect(queue_time).to be_within(10).of(60) # 100 - 40
696+
queue_time = transaction.contexts.dig(:trace, :data, 'http.queue_time_ms')
697+
expect(queue_time).to be_within(10).of(60) # 100 - 40
698+
end
697699
end
698700

699701
it "handles different timestamp formats" do

0 commit comments

Comments
 (0)