File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed
sentry-ruby/spec/sentry/rack Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments