Skip to content

test(dashboard): Fix the /api/versions ECONNRESET and split the slow Inbox shot test - #4265

Merged
BYK merged 5 commits into
mainfrom
byk/inbox-versions-and-split
Nov 25, 2026
Merged

BYK merged 5 commits into
mainfrom
byk/inbox-versions-and-split

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Nov 24, 2026

Copy link
Copy Markdown
Contributor

Fixes #4260

/api/versions ECONNRESET. The e2e server runs inside the Playwright worker, so its idle timer and route.fetch share one event loop. route.fetch reuses keep-alive connections. Node closes an idle connection after its keep-alive timeout of 5 s plus a 1 s buffer. When route.fetch sends on a connection in the same loop turn that the idle timer fires, the server destroys the socket before it reads the request, and the client gets a reset. The versions poll waits 5 s between requests, so on a busy worker it can land on that close. mockInboxItems forwards every poll with route.fetch, so Inbox specs hit it most.

The harness now sets keepAliveTimeout = 0, so the server never closes idle connections. close() already calls closeAllConnections() at the end of each test. This fixes the race for every route.fetch in the dashboard e2e suite. The versions route keeps forwarding to the real server, because its conversations and conversationDetails tokens follow the mock server's state.

Slow Inbox test. "each entry lists its own rows under its name" took four screenshots in one test: code-mine, inbox-decisions, inbox-conversations and inbox-automations, each in light and dark at desktop and phone size. Those 16 captures shared one 30 s test timeout, so a busy machine ran past it in whichever capture was running. It is now a describe with one test per view and a shared beforeEach. Each test takes the same path to its view as before, and the screenshot names do not change.

via @BYK.

--

View Session [Sentry]

sentry-junior Bot and others added 2 commits November 24, 2026 23:47
route.fetch on /api/versions failed now and then with ECONNRESET on a
loaded machine. The e2e server runs in the Playwright worker, so its
idle timer and route.fetch share one event loop. route.fetch reuses a
keep-alive connection. When it sends on one just as the server's idle
timeout (5 s plus a 1 s buffer) fires, the server closes the connection
before it reads the request. The versions poll waits 5 s between
requests, so a busy worker can push it onto that close.

Turn off the server's keep-alive timeout. close() already closes every
connection when the test ends.

Fixes #4260

Co-Authored-By: BYK <[email protected]>
"each entry lists its own rows under its name" took four light and dark
screenshots at desktop and phone size in one test. On a busy machine it
ran past the 30 s test timeout. Give each view its own test, with the
same setup and screenshot names.

Co-Authored-By: BYK <[email protected]>
@sentry-junior
sentry-junior Bot requested a review from BYK November 24, 2026 23:52
@vercel

vercel Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
junior-docs Ready Ready Preview Nov 25, 2026 1:59pm UTC

Request Review

@github-actions github-actions Bot added the risk: medium PR risk score: medium label Nov 24, 2026
…d-split

# Conflicts:
#	packages/junior-dashboard/e2e/inbox/inbox.spec.ts
@github-actions

github-actions Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

1 screenshot change — 1 changed · 0 added · 0 removed

Review screenshots in Frameshift

Conversation Stop Active · Mobile
Conversation Stop Active · Mobile
Changed

@BYK
BYK enabled auto-merge (squash) November 25, 2026 11:26
sentry-junior Bot and others added 2 commits November 25, 2026 12:35
…d-split

# Conflicts:
#	packages/junior-dashboard/e2e/inbox/inbox.spec.ts
@BYK
BYK merged commit 8ab5d93 into main Nov 25, 2026
54 of 55 checks passed
@BYK
BYK deleted the byk/inbox-versions-and-split branch November 25, 2026 14:07
sentry-junior Bot added a commit that referenced this pull request Nov 25, 2026
…rver

A spec that forwards a read with `route.fetch` and edits the response
puts a second mock layer on top of the in-process mock server, and the
read runs in both at once. That caused #3316 (a response
disposed mid-handler when the test ended) and #4265
(ECONNRESET when the forward reused a connection that the server was
closing).

test-architecture:check gets a dashboard-e2e-route-forward rule for
specs and helpers. Its baseline is today's 65 uses. A new test adds its
state to src/mock-reporting, or fulfills the whole response.

Refs #4341

Co-Authored-By: David Cramer <[email protected]>
sentry-junior Bot added a commit that referenced this pull request Nov 25, 2026
…rver

A spec that forwards a read with `route.fetch` and edits the response
puts a second mock layer on top of the in-process mock server, and the
read runs in both at once. That caused #3316 (a response
disposed mid-handler when the test ended) and #4265
(ECONNRESET when the forward reused a connection that the server was
closing).

Every forward now fulfills the whole response. It builds the answer
with e2e/mock-reports.ts, which reads the mock server's own report
builders from the built dashboard, so the answer holds the test's
earlier writes. The mock routes for the feed, Conversation detail, Inbox
items, search, and notification settings now share those builders.

test-architecture:check gets a dashboard-e2e-route-forward rule for
specs and helpers, with no baseline.

Refs #4341

Co-Authored-By: David Cramer <[email protected]>
sentry-junior Bot added a commit that referenced this pull request Nov 25, 2026
…rver

A spec that forwards a read with `route.fetch` and edits the response
puts a second mock layer on top of the in-process mock server, and the
read runs in both at once. That caused #3316 (a response
disposed mid-handler when the test ended) and #4265
(ECONNRESET when the forward reused a connection that the server was
closing).

Every forward now fulfills the whole response. It builds the answer
with e2e/mock-reports.ts, which reads the mock server's own report
builders from the built dashboard, so the answer holds the test's
earlier writes. The mock routes for the feed, Conversation detail, Inbox
items, search, and notification settings now share those builders.

test-architecture:check gets a dashboard-e2e-route-forward rule for
specs and helpers, with no baseline.

Refs #4341

Co-Authored-By: David Cramer <[email protected]>
sentry-junior Bot added a commit that referenced this pull request Nov 25, 2026
…rver

A spec that forwards a read with `route.fetch` and edits the response
puts a second mock layer on top of the in-process mock server, and the
read runs in both at once. That caused #3316 (a response
disposed mid-handler when the test ended) and #4265
(ECONNRESET when the forward reused a connection that the server was
closing).

Every forward now fulfills the whole response. It builds the answer
with e2e/mock-reports.ts, which reads the mock server's own report
builders from the built dashboard, so the answer holds the test's
earlier writes. The mock routes for the feed, Conversation detail, Inbox
items, search, and notification settings now share those builders.

test-architecture:check gets a dashboard-e2e-route-forward rule for
specs and helpers, with no baseline.

Refs #4341

Co-Authored-By: David Cramer <[email protected]>
sentry-junior Bot added a commit that referenced this pull request Nov 25, 2026
…rver

A spec that forwards a read with `route.fetch` and edits the response
puts a second mock layer on top of the in-process mock server, and the
read runs in both at once. That caused #3316 (a response
disposed mid-handler when the test ended) and #4265
(ECONNRESET when the forward reused a connection that the server was
closing).

Every forward now fulfills the whole response. It builds the answer
with e2e/mock-reports.ts, which reads the mock server's own report
builders from the built dashboard, so the answer holds the test's
earlier writes. The mock routes for the feed, Conversation detail, Inbox
items, search, and notification settings now share those builders.

test-architecture:check gets a dashboard-e2e-route-forward rule for
specs and helpers, with no baseline.

Refs #4341

Co-Authored-By: David Cramer <[email protected]>

This branch was successfully deployed

1 active deployment
Preview – junior-docs — 3f3f0666 Deployed Nov 25, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk: medium PR risk score: medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Flaky: dashboard e2e mock resets on /api/versions (route.fetch ECONNRESET) under load

1 participant