Fix/241 e2e isolation part2 #252

Merged
bermudalamb merged 2 commits from fix/241-e2e-isolation-part2 into main 2026-09-01 08:32:15 -05:00
Owner
No description provided.
bermudalamb added 2 commits 2026-09-01 08:32:07 -05:00
Tasks 2 to 4 of the plan. Nine `collection.find(...)` dereferences become findOrFail, so a missing row fails as a named assertion naming what was wanted and how many rows were searched, rather than "Cannot read properties of undefined" pointing at test plumbing. Where the old code followed the lookup with expect(x).toBeTruthy(), that assertion is dropped: findOrFail already guarantees it, and with a better message.

The expect timeout goes from Playwright's default 5s to 10s. It costs nothing on a green run — it bounds how long a failing assertion waits, not how long a passing one takes — and #239 died reporting exactly Timeout: 5000ms on a runner that also builds, migrates and runs three other suites.

The admin-save happy path comes back from the #245 skip. It is the only end-to-end check that adding an item reaches the database rather than merely firing a toast, and it passed both full parallel runs and in isolation.

filters.spec.ts:216 is deliberately untouched: its .find() searches CSS class names on a string array, not test data, and has no missing-row failure mode.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
test(e2e): run the suite on one worker so a red run means something (#241)
SonarQube Analysis / sonarqube (pull_request) Failing after 1m43s
Linting / lint (pull_request) Successful in 2m37s
6489486de3
The lever the plan deliberately held back, applied now that there is evidence it is needed. Better failure messages and a wider assertion timeout were not enough.

Measured on this branch, same commit, same machine. Two parallel runs each failed 3 of 155, and not the same three: password-reset and admin-inventory-filters in one, admin-email-settings, admin-inventory-filters and resend-verification in the next. All 16 tests from those three specs then passed when run serially, and the full suite passed 155 of 155 twice in a row. Failures that move between runs of identical code are contention, not defects — specs asserting over tables other specs are concurrently writing to.

The cost is about three minutes, roughly one minute parallel against 3.9 and 4.0 serially. A red run that means something is worth three minutes; the previous state was a suite whose result nobody could act on, which is what #245 had to skip a real test to work around.

If that time is ever needed back, the cheaper fix is giving each worker its own database rather than raising this number and reopening #241.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
bermudalamb merged commit 789bb32450 into main 2026-09-01 08:32:15 -05:00
bermudalamb deleted branch fix/241-e2e-isolation-part2 2026-09-01 08:32:15 -05:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: bermudalamb/redefined-designs#252