Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Delete all alarms on abortAllDurableObjects() #1918

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mrbbot
Copy link
Contributor

@mrbbot mrbbot commented Mar 28, 2024

Fixes cloudflare/workers-sdk#5388

In the Workers Vitest integration, we call the abortAllDurableObjects() function after each test to abort all Durable Objects and close all SQLite databases. If the isolated storage option is enabled, we backup/restore .sqlite files to automatically undo writes performed in tests. Right now, this doesn't cancel Durable Object alarms. This means that an alarm scheduled in one test might end up firing when another later test is running. This could lead to unexpected test results, and non-determinism in tests.

This PR addresses this issue by automatically deleting all Durable Object alarms when abortAllDurableObjects() is called. This is a local-only internal API that's currently only used in the Vitest integration, so making this breaking change is fine. 馃憤

@mrbbot mrbbot requested review from a team as code owners March 28, 2024 12:59
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.

Reset Durable Object alarms between tests
2 participants