Repository navigation
test(e2e), fix(upload): network-fault tests, part 1 of 3 (#71) - #104
Merged
Merged
Conversation
Layer 1 of #71: Playwright breaks the browser's own requests, then checks that the app fails safely: nothing left in storage, nothing counted twice, a clear message, and recovery once the network is back. - e2e/faults: fault helpers (fail, hold, delay, cut, offline, service worker registration), checks through docker exec (Postgres rows, storage multipart uploads via mc, ERR/FTL lines in the API log), shared steps - Scenarios 1, 2, 11, 12 (uploads) and 7, 8 (downloads); 7 and 8 also run in Firefox and WebKit - New faults, faults-firefox and faults-webkit projects (one worker each); the other projects skip e2e/faults, and CI's existing run picks them up - fix(upload): a failed part or a lost connection showed "Client Error: Request failed with status code 500" or "Client Error: Network Error". Uploads now say what happened and that nothing was shared Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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 1 of 3 for #71. This is Layer 1: Playwright breaks the browser's own requests, then each test checks that the app fails safely.
What's in it
e2e/faults/:faults.ts: fault helpers (failRequests,failNthRequest,holdRequests,delayRequests,cutResponseAfter,failServiceWorkerRegistration,goOfflineFor).checks.ts: after-test checks throughdocker exec, so no test-only API endpoints:mc;ERR/FTLlines in the API log.flows.ts: shared steps.README.md: how to run them, plus the browser quirks below.Scenarios, numbered as in the issue:
@cross-browser@cross-browser503 SlowDownon every part's first attemptPlaywright projects:
faults,faults-firefoxandfaults-webkit, one worker each. The existing projects skipe2e/faults. CI's existingnpx playwright testruns them, soci.ymlis unchanged.fix(upload): scenarios 1 and 11 found that a failed part or a lost connection showed
Client Error: Request failed with status code 500/Client Error: Network Error. The newdescribeUploadError(with unit tests) says what happened and that nothing was shared. The API's own JSON errors and the empty 429 keep their current wording.Browser quirks found on the way (in
e2e/faults/README.md)unrouteAll. So the download cut and the registration failure are done inside the page instead, with init scripts. Scenario 7 asserts that Chromium's retry really went through the worker.showSaveFilePicker, as Firefox lacks it.Not in this PR
SessionLifetimeas an option, capped at the production default (it sizes the Storage: lifecycle rule as a safety net so no file outlives the app's limits #69 lifecycle rule), plus a shortened scenario 9.docker-compose.faults.yml), scenarios 3, 4, 5, 6, 9, 10, and their own workflow.Checked locally
CI=1 npx playwright test: every fault scenario passes in all three projects; scenario 8 is skipped on WebKit by design. The one failure is the existingphotoMetadatatest 9 on WebKit, because Playwright's WebKit on Windows has noOffscreenCanvas. That's unrelated to this PR, and CI runs on Linux.vitest: 42 files, 381 passed.npm run buildandnpm run lintare clean.🤖 Generated with Claude Code