-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Reset Durable Object alarms between tests #5388
Description
Currently, Durable Object alarms are not reset between test runs and do not respect isolated storage. You must delete or run all alarms with runDurableObjectAlarm() scheduled in each test before finishing the test, to ensure rouge alarms don't fire later.
To fix this, we should probably cancel all alarms in the abortAllDurableObjects() function:
This function is called before/after each test when isolatedStorage is enabled, which is when we'd like all alarms to be cancelled. As far as I know, locally workerd uses an in-memory alarm scheduler, so it should be possible to clear these without needing to write to storage.
See https://github.com/cloudflare/workerd/blob/9651cc9b814b20d4674f1b0cba2e83ebbfbc8c38/src/workerd/server/server.c%2B%2B#L2534-L2551 for the workerd implementation of the abort all function.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status