Skip to content

Commit 5f46918

Browse files
committed
fix: add timing tolerance to test_generate_with_jitter
Relax the lower bound from 3.0 to 2.99 seconds to account for microsecond-level precision variations in timing checks. The test was failing intermittently on Python 3.12 with delta values like 2.9999... which are technically valid but fell just under the strict 3.0 threshold. Signed-off-by: Ntege Daniel <danientege785@gmail.com>
1 parent a36dd29 commit 5f46918

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

tests/unit/timestamp_test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,8 +191,8 @@ def test_generate_with_jitter():
191191
ts = Timestamp.generate(has_jitter=True)
192192
delta = time.time() - ts.to_date().timestamp()
193193

194-
# Jitter is explicitly 3-8 seconds backward
195-
assert 3.0 <= delta <= 9.0
194+
# Jitter is explicitly 3-8 seconds backward (with small tolerance for timing precision)
195+
assert 2.99 <= delta <= 9.0
196196

197197

198198
# Protobuf serialization tests

0 commit comments

Comments
 (0)