Repository navigation
The partial-reset test reads the storage keys after the autosave has landed - #651
Merged
Merged
Conversation
…landed Part of #623. resetAll() schedules the autosave 400 ms later; on a slow runner its write landed between the key read and the partial reset, and the count check failed on both attempts. The test now flushes the pending autosave and waits for the document record first, and checks that exactly the storage mode was removed, nothing arrived and the refused document record stays. Test only.
Deploying cozy-loop-studio with
|
| Latest commit: |
4a3648c
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://f08ef3cc.cozy-loop-studio.pages.dev |
| Branch Preview URL: | https://e423-wait-for-autosave.cozy-loop-studio.pages.dev |
This was referenced Nov 23, 2026
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.
Part of #623 (its first item). Test only; no product change.
What was wrong
e2e/error-paths-423.spec.ts, "Reset all data: a removal refused after others succeeded …", failed now and then withexpect(after).toBeLessThan(before)— Expected: < 4, Received: 4, on the first try and on its retry (#609's CI, shard 1/8; #576's CI, shard 5/8). A job rerun of the same head passed.The cause is in the test.
resetAll()(e2e/support/loop.ts) callsnewGraph(), which schedules the autosave 400 ms later (src/store/graphStore.ts:961). The test read the keys and then ran a partial reset; when that write ofloop-studio:graph:v1landed between the two, one key went (storage-mode) and one arrived (graph:v1), so the count did not move. The partial reset leaves storage open, so the late write is not stopped. A retry runs the same steps in a fresh context on the same slow runner and meets the same window.At normal speed the write came after the test, so
graph:v1did not exist when the reset ran: the refused second removal was a removal of nothing.The change
Only
e2e/error-paths-423.spec.ts:resetAll, the pending autosave is written (__loop.autosave.flush(), thepagehidepath, used by ten other specs) and the test waits untilloop-studio:graph:v1is stored, before it patchesremoveItemand reads the keys;loop-studio:storage-modewas removed, that no key arrived, and thatloop-studio:graph:v1, whose removal was refused, is still there.Evidence
The slow condition: the CPU throttled ×3 (CDP
Emulation.setCPUThrottlingRate), the old and the new test body copied as they are, 10 runs each, one worker, no retries:14514210)Earlier probes of the same steps: the old test failed 4 of 5 (2026-11-22) and 2 of 5 (2026-11-23) at ×3, and passed at ×1 and ×6; with the flush first it passed 15 of 15 at ×1, ×3 and ×6, the removed key always
storage-modeand nothing arriving.The fixed test at normal speed,
--repeat-each=20, one worker, no retries: 20 passed. The whole spec file: 3 passed.Local:
check:*script: 0 failed;tsc -b: clean;No unit test or other spec changes. CI cannot be throttled, so the repeated runs above are the evidence that the window is closed.