@@ -434,12 +434,11 @@ def test_event_is_pushed_even_without_block
434434
435435 class EventTest < TestCase
436436 def test_events_are_initialized_with_details
437- time = Time . now
437+ time = Time . now . to_f
438438 event = event ( :foo , time , time + 0.01 , random_id , { } )
439439
440440 assert_equal :foo , event . name
441- assert_equal time , event . time
442- assert_in_delta 10.0 , event . duration , 0.00001
441+ assert_in_delta 10.0 , event . duration , 0.0001
443442 end
444443
445444 def test_event_cpu_time_does_not_raise_error_when_start_or_finished_not_called
@@ -450,14 +449,14 @@ def test_event_cpu_time_does_not_raise_error_when_start_or_finished_not_called
450449 end
451450
452451 def test_events_consumes_information_given_as_payload
453- event = event ( :foo , Concurrent . monotonic_time , Concurrent . monotonic_time + 1 , random_id , payload : :bar )
452+ event = event ( :foo , Process . clock_gettime ( Process :: CLOCK_MONOTONIC ) , Process . clock_gettime ( Process :: CLOCK_MONOTONIC ) + 1 , random_id , payload : :bar )
454453 assert_equal Hash [ payload : :bar ] , event . payload
455454 end
456455
457456 def test_event_is_parent_based_on_children
458- time = Concurrent . monotonic_time
457+ time = Process . clock_gettime ( Process :: CLOCK_MONOTONIC )
459458
460- parent = event ( :foo , Concurrent . monotonic_time , Concurrent . monotonic_time + 100 , random_id , { } )
459+ parent = event ( :foo , Process . clock_gettime ( Process :: CLOCK_MONOTONIC ) , Process . clock_gettime ( Process :: CLOCK_MONOTONIC ) + 100 , random_id , { } )
461460 child = event ( :foo , time , time + 10 , random_id , { } )
462461 not_child = event ( :foo , time , time + 100 , random_id , { } )
463462
0 commit comments