Skip to content

fix(cryptography): measure timelock elapsed time with the clock - #2321

Open
osbre wants to merge 1 commit into
tempestphp:3.xfrom
osbre:fix/timelock-mocked-clock
Open

osbre wants to merge 1 commit into
tempestphp:3.xfrom
osbre:fix/timelock-mocked-clock

Conversation

@osbre

@osbre osbre commented Oct 23, 2026

Copy link
Copy Markdown
Contributor

Fixes the flaky TimelockTest::uses_mocked_clock (failed run).

Timelock measured elapsed time with microtime() but slept on the injected clock, so under MockClock the real microseconds spent in the callback were subtracted from the sleep, occasionally landing on 9999 ms instead of 10000. It now measures with the clock too, and the test burns 1 ms of real time so it fails deterministically without the fix.

@osbre
osbre requested a review from innocenzi as a code owner October 23, 2026 14:19
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.

1 participant