Seed the scheduler revocation fixture in one Durable Object invocation - #111
Conversation
The revocation-cleanup test has to leave more rows behind than one alarm pass clears, so it enables sixty schedules -- but it did so as sixty separate runInDurableObject round-trips, which is where nearly all of its runtime went. On an idle machine it took 2.9-4.3s of the 5s default test timeout, and it exceeded it outright when the monorepo suite runs in parallel. Enable them inside a single invocation instead. Same enable() path, so each schedule still gets its capabilities row and the cleanup assertions are unchanged; the test now runs in about 1s.
|
All contributors have signed the CLA ✍️ ✅ |
|
I have read the CLA Document and I hereby sign the CLA |
|
@ask-bonk review this |
|
The change is a faithful inlining. It calls the same One thing to consider: the PR description mentions a separate flaky test ( LGTM! |
ScheduleDriver > permanently fences mutations and cleans revoked storage in bounded alarm passeshas to leave behind more rows than a single#cleanupRevokedAccountpass clears, so it enables sixty schedules first. It did that as sixty separaterunInDurableObjectround-trips, and that setup is where nearly all of the test's runtime went.That put it uncomfortably close to vitest's 5s default: on an idle machine it measured 2.9s–4.3s, and under the CPU contention of the full
pnpm -r testit exceeded the timeout outright.Enabling them inside a single invocation keeps the test identical in substance — it is still the real
enable()path, so every schedule still gets itscaps:row and the cleanup assertions are untouched — while removing the round-trip cost.Verification
Duration of that test within a full
schedule-driver.test.tsrun, three runs each, same machine, nothing else running:mainpnpm exec tsc --noEmitis clean. The one remaining failure in this file on this branch isbounds callback concurrency and immediately continues a due backlog, which is a separate assertion flake addressed in #103; the two branches touch different regions of the file and merge cleanly.