Skip to content

Fix flaky time test on PyPy - #244

Open
astronomiwe wants to merge 1 commit into
oittaa:mainfrom
astronomiwe:fix-227-deterministic-time-test
Open

astronomiwe wants to merge 1 commit into
oittaa:mainfrom
astronomiwe:fix-227-deterministic-time-test

Conversation

@astronomiwe

Copy link
Copy Markdown

Fixes #227.

Replace the timing-sensitive comparison between uuid1() and uuid6() with deterministic clock-based assertions for UUIDv6, UUIDv7, and UUIDv8. The test resets monotonic timestamp state and validates each encoded timestamp exactly.

Validation:

  • python -m black --check .
  • flake8 (both CI invocations)
  • python -m mypy
  • coverage run -m unittest discover (28 tests, 100% coverage)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test.test_uuid6.UUIDTests.test_time fails on PyPy3.11 (extremely fragile to timing)

1 participant