Repository navigation
test(account): check P22's expiry from the replacement's own stamp - #4386
Conversation
…ot a clock read before it
|
No actionable comments were generated in the recent review. Summary
Merge Risk:
|
|
Merged through Test-only fix of a clock race in P22 (no product change). Reviews: dori review (omo) CLEAR at 9ec0c06 and CodeRabbit reviewed this head; test-only PRs need omo alone (OVIS-RULES). Proven with a preload that ticks Date.now 5 ms per call: before fails, after passes. check fast exit 0 on hosthatch. |
Summary
server/account/link-replacement.test.ts(P22) readDate.now()beforelinkAccountKey, which stamps the replacement with its ownDate.now(). When the clock moved a millisecond between the two,now + FIVE_MINUTES + 1was still inside the five minutes and the replacement was confirmed, so the test failed now and then (seen in acheck fastrun on hosthatch while checking #4384; it passed 6/6 locally). The test now takes the time the replacement was stamped with frompendingReplacementand checks one millisecond past its five minutes. No product change.Validation
Date.now()5 ms per call: before, P22 fails; after, it passes.bun test server/account/link-replacement.test.ts: 10 pass, 3 runs.bun run check fast(remote, hosthatch): exit 0 before this push.