Skip to content

fix(e2e): ride out dev-server stalls in sign-in; await the profile save before reloading - #105

Merged
krazymir merged 1 commit into
mainfrom
claude/user-photo-404-errors-799bc6
Oct 21, 2026
Merged

krazymir merged 1 commit into
mainfrom
claude/user-photo-404-errors-799bc6

Conversation

@krazymir

Copy link
Copy Markdown
Collaborator

What

Three e2e fixes from Jenkins build 191, which failed on one spec and flagged five as flaky. Test only, so there's no version bump and no changelog entry.

Why

Every failure lined up with two windows where the next dev server stalled. Single requests took 15–32 s, the watchdog's 5 s health probe timed out, and Turbopack logged a 10 s "filesystem cache database compaction". Three tests failed in the same second at the end of the first stall. On top of that, one test had a genuine race.

The noise in the server log is not related. The many /api/users/:id/photo 404s are the gateway working as specified: dev personas have no Entra photo. The uncaughtException: Error: aborted (ECONNRESET) blocks are a known Next.js bug (vercel/next.js#84649, #99278), and the server only logs them and keeps running.

Changes

  • e2e/discovery.spec.ts: the profile's e-mail switch flips optimistically before its PATCH /api/profile lands. The test reloaded right after the click, which aborted the save (the server logged client disconnected for /api/profile), so the reload read the old value. It now waits for the PATCH response before reloading.
  • e2e/helpers/auth.ts (signIn): the whole sign-in is now retried, for up to 100 s, not just the panel load.
    • Each attempt reloads Home and waits for whichever renders first: the account menu or the dev panel.
    • If the menu is already there, an earlier attempt's slow callback landed. The persona is not posted again, because that would re-seed it (for example, reset fresh onboarding).
    • The 30 s wait for .user-trigger was the most common failure point, since every test signs in.
  • e2e/public-submissions.spec.ts: the two end-to-end flows (submit → confirm → accept, and Specific people) call test.slow(), the same convention the directory-card and admin-settings specs use.
    • Specific people does three sign-ins, a proof-of-work wait, confirm, accept, a triage move and an inbox check. It failed all three attempts in build 191.
    • It runs in the serial platform-state project, so its first retry was skipped behind the preceding test's timeout and its second landed in the next stall.

Reviewer notes

  • Not run against a dev server yet: the next CI run is the real check. The three files type-check (tsc --strict, checked separately) and playwright test --list loads every affected spec.
  • Coverage gap, not fixed here: pnpm typecheck does not see e2e/ (the web tsconfig includes only src), and ESLint ignores e2e/ too. A type error in a spec would only show up when Playwright transpiles it.
  • The stalls themselves look like Turbopack persistent-cache compaction and memory eviction on the agent. The archived e2e-host-stats.log from build 191 would confirm that.

…ve before reloading

Jenkins build 191 failed on one spec and flagged five as flaky. Every failure
lined up with two windows where the next dev server stalled for up to 30 s per
request (Turbopack cache compaction), plus one genuine race.

- discovery.spec: the e-mail switch flips optimistically before its PATCH lands,
  and the test reloaded straight away, aborting the save ("client disconnected"
  for /api/profile) so the reload read the old value. It now waits for the
  PATCH response before reloading.
- helpers/auth signIn: the whole sign-in is retried (up to 100 s), not just the
  panel load. Each attempt waits for the account menu or the dev panel; if the
  menu is already there, an earlier slow callback landed and the persona is not
  posted again (which would re-seed it, e.g. reset fresh onboarding).
- public-submissions.spec: the two end-to-end flows (submit/confirm/accept and
  Specific people) get test.slow(); the Specific-people flow cannot fit 120 s on
  a stalled server and failed all three attempts.

Test-only: no version bump, no changelog entry.
@krazymir
krazymir merged commit 1847bc3 into main Oct 21, 2026
13 checks passed
@krazymir
krazymir deleted the claude/user-photo-404-errors-799bc6 branch October 21, 2026 16:29
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.

1 participant