Seed the scheduler revocation fixture in one Durable Object invocation - #111
Open
RenKoya1 wants to merge 1 commit into
Open
Seed the scheduler revocation fixture in one Durable Object invocation#111RenKoya1 wants to merge 1 commit into
RenKoya1 wants to merge 1 commit into
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 ✍️ ✅ |
Author
|
I have read the CLA Document and I hereby sign the CLA |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.