Skip to content

Commit dcec3b0

Browse files
committed
sdk: make test_batch_span_processor_scheduled_delay a bit more robust
It happened that tests failed because the delay was fired some microseconds earlier: > self.assertGreaterEqual((export_time - start_time) * 1e3, 500) E AssertionError: 499.9737739562988 not greater than or equal to 500 Use assertAlmostEqual to accept a similar enough value (places=0) and avoid too big values. Fix #3911
1 parent ba22b16 commit dcec3b0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

opentelemetry-sdk/tests/trace/export/test_export.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,7 @@ def test_batch_span_processor_scheduled_delay(self):
482482
self.assertTrue(export_event.wait(2))
483483
export_time = time.time()
484484
self.assertEqual(len(spans_names_list), 1)
485-
self.assertGreaterEqual((export_time - start_time) * 1e3, 500)
485+
self.assertAlmostEqual((export_time - start_time) * 1e3, 500, places=0)
486486

487487
span_processor.shutdown()
488488

0 commit comments

Comments
 (0)