Repository navigation
fix(test): drive follow-through waits from the mocked clock (#821) - #833
Conversation
…wLab#821) `settle` spun on setImmediate against a wall-clock 3 s deadline while the case mocked `setTimeout`, so a wait that needed a tick could never progress on a loaded runner and reported "condition not reached" for a green PR (Test run 39917377405 attempt 1, head f027324) that passed on rerun. One `mockTimers(t)` helper now enables the mocked clock and registers it, and `settle` advances that clock in bounded rounds, so no wait in the file races wall time. The cleared-note wait in the failing case no longer asserts inside the helper: the following assertion judges the write, so removing it fails on "the exchange a turn took up is still noted on disk". Regenerated patches/ds-bot/0001-core-fixes.patch.
|
Verdict: PASS at 0f0006f The waits in this file now run on the clock the case controls, not on wall time: What I checked:
Non-blocking:
Not run: Ran at this tip (0f0006f), in a copy of it: |
|
Written-by: Test PASS at Where: fresh checkout of my own at Ran: Ran: 30 consecutive runs of Ran, knife: removed the clearing write ( Not run: CI and the merge queue (GitHub); no deliberate attempt to reproduce the original timeout by slowing the runner (the mocked-clock change is covered here by 30 repeated runs plus the knife, not by recreating the loaded CI machine); no packaged-app run, and no behaviour outside the test file was touched. Written-by: Test |
fix(test): drive follow-through waits from the mocked clock (#821)
Fixes #821
Tip SHA: 0f0006f
What changed
core/test/follow-through.test.jswaited onsetImmediateagainst a wall-clock 3 s deadline while the case mockedsetTimeout; a wait that needs a tick can never progress that way, so a loaded runner failed it ascondition not reachedon a green PR (Test run 39917377405 attempt 1, headf027324e) that passed on rerun.mockTimers(t)helper enables and registers the mocked clock; everysettleadvances it in bounded rounds, so no wait in the file hangs on wall-clock and the next case inherits the safe waitassert.equaljudges the write, so removing the clearing write fails on "the exchange a turn took up is still noted on disk"patches/ds-bot/0001-core-fixes.patchregenerated withnode scripts/ds-bot-patches.mjs generate.Ran
TZ=UTC npm run verifyat the root: passnode --test test/follow-through.test.js×100: 100/100 greenforgetQueued(...)fromcore/src/host/resume.js; the case failed on its own assertion, then restoredNot run
index.jsorsrc/hostchange in the diff)