Skip to content

Seed the scheduler revocation fixture in one Durable Object invocation - #111

Open
RenKoya1 wants to merge 1 commit into
cloudflare:mainfrom
RenKoya1:test/scheduler-revocation-fixture
Open

Seed the scheduler revocation fixture in one Durable Object invocation#111
RenKoya1 wants to merge 1 commit into
cloudflare:mainfrom
RenKoya1:test/scheduler-revocation-fixture

Conversation

@RenKoya1

Copy link
Copy Markdown

ScheduleDriver > permanently fences mutations and cleans revoked storage in bounded alarm passes has to leave behind more rows than a single #cleanupRevokedAccount pass clears, so it enables sixty schedules first. It did that as sixty separate runInDurableObject round-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 test it 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 its caps: row and the cleanup assertions are untouched — while removing the round-trip cost.

Verification

Duration of that test within a full schedule-driver.test.ts run, three runs each, same machine, nothing else running:

run 1 run 2 run 3
main 2939ms 3156ms 4310ms
this branch 1013ms 1091ms 1016ms

pnpm exec tsc --noEmit is clean. The one remaining failure in this file on this branch is bounds 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.

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.
@github-actions

github-actions Bot commented Aug 10, 2026

Copy link
Copy Markdown

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@RenKoya1

Copy link
Copy Markdown
Author

I have read the CLA Document and I hereby sign the CLA

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