Fix e2e test timeouts caused by blocking fetch in loadExistingMessages#100
Merged
Fix e2e test timeouts caused by blocking fetch in loadExistingMessages#100
Conversation
…sages, use .node-version Co-authored-by: mahata <23497+mahata@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] [66899388030] Fix failing GitHub Actions workflow e2e
Fix e2e test timeouts caused by blocking fetch in loadExistingMessages
Mar 13, 2026
mahata
approved these changes
Mar 13, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR addresses Playwright e2e timeouts caused by an initial fetch("/api/messages") from the chat page blocking subsequent navigations in CI, and also updates CI/local tooling around Node + Playwright setup.
Changes:
- Add a timeout + abort to
loadExistingMessages()to prevent long-running message loads from blocking navigation. - Update Playwright webServer startup to build client assets before starting the server.
- Replace
.nvmrcwith.node-versionand adjust CI + e2e logout assertion to be less externally dependent.
Reviewed changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
hono/static/ChatPage.ts |
Abort fetch("/api/messages") after 5s and clear timer to avoid long hangs affecting navigation. |
playwright.config.ts |
Build client assets before starting the Playwright webServer. |
e2e/app.spec.ts |
Make logout assertion internal/UI-based rather than relying on Google redirect URL. |
.github/workflows/ci.yml |
Use .node-version, switch Playwright install to pnpm exec, and formatting cleanups. |
.nvmrc |
Removed in favor of .node-version. |
.node-version |
Added to pin Node 22 in a broadly-supported way. |
.gitignore |
Ignore .github/prompts/*.md. |
You can also share your feedback on Copilot code review. Take the survey.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
* Initial plan * Fix e2e test timeouts: increase timeout to 60s, remove external image from mock user Co-authored-by: mahata <23497+mahata@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: mahata <23497+mahata@users.noreply.github.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.
All 5 e2e tests were timing out at
page.goto("/")in the test body. Server logs showed a consistent ~20-second gap betweenbeforeEachcompleting and the test body's navigation reaching the server — with zero server activity in between.Root cause: After
loginWithMock'spage.goto("/")loads the ChatPage,loadExistingMessages()immediately firesfetch("/api/messages"). This is the first DB connection from the freshly-started webServer process;pg.Poolcold-start takes ~20s in CI. While that fetch was pending, Chrome held the subsequentpage.goto("/")request (Playwright/CDP tracking + HTTP/1.1 connection pool pressure from WebSocket + fetch + keep-alive connections). The ~20s wait consumed the 30s test budget.Fix
hono/static/ChatPage.ts: AddedAbortControllerwith a 5-second timeout toloadExistingMessages. Aborted fetch signals completion to Chrome immediately, unblocking navigation.clearTimeoutinfinallyto prevent timer leaks.Refactor changes (from
refactor/no-nvm-dependencybranch).nvmrc→.node-version: Replaced nvm-specific file with the broadly-supported.node-versionformat; both contain22.ci.yml: Usenode-version-file: ".node-version"andpnpm exec playwright installinstead ofnpx.playwright.config.ts: WebServer command changed topnpm build:client && pnpm start— ensures client JS is compiled for localpnpm test:e2eruns without a prior build.e2e/app.spec.ts: Logout test checks.user-emailnot visible instead of asserting Google OAuth URL redirect (avoids external network dependency in assertion)..gitignore: Exclude.github/prompts/*.md.Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.