Skip to content

Fixed E2E route teardown races - #29624

Open
kevinansfield wants to merge 1 commit into
mainfrom
agent/fix-member-route-teardown-race
Open

Fixed E2E route teardown races#29624
kevinansfield wants to merge 1 commit into
mainfrom
agent/fix-member-route-teardown-race

Conversation

@kevinansfield

Copy link
Copy Markdown
Member

What changed

  • Wait for active Playwright page route handlers to finish before fixture teardown closes the browser context.

Why

A page.route() handler can still be reading a fetched response after the test body returns. Closing the context at that point disposes the response and surfaces an unhandled apiResponse.json: Response has been disposed error, as seen in this flaky CI run.

Using Playwright's wait teardown behavior drains active handlers without swallowing genuine handler errors.

no issue
Playwright could close browser contexts while route handlers were still reading responses, leaking disposed-response errors into otherwise successful tests.
@coderabbitai

coderabbitai Bot commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 0cca5849-c6ff-4a2e-bed1-a7029219050c

📥 Commits

Reviewing files that changed from the base of the PR and between fd1a680 and fdd8d92.

📒 Files selected for processing (1)
  • e2e/helpers/playwright/fixture.ts

Walkthrough

The Playwright page fixture now calls page.unrouteAll({ behavior: 'wait' }) after test execution completes, removing active routes before the remaining teardown logic runs.

Suggested reviewers: 9larsons

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly matches the main change: fixing E2E route teardown races in Playwright fixture cleanup.
Description check ✅ Passed The description accurately explains the teardown timing issue and the use of Playwright's wait behavior.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch agent/fix-member-route-teardown-race

Comment @coderabbitai help to get the list of available commands.

@nx-cloud

nx-cloud Bot commented Jul 27, 2026

Copy link
Copy Markdown

🤖 Nx Cloud AI Fix

Ensure the fix-ci command is configured to always run in your CI pipeline to get automatic fixes in future runs. For more information, please see https://nx.dev/ci/features/self-healing-ci


View your CI Pipeline Execution ↗ for commit fdd8d92

Command Status Duration Result
nx run @tryghost/admin:build ✅ Succeeded 11s View ↗
nx run ghost-monorepo:lint:boundaries ✅ Succeeded <1s View ↗
nx run-many -t lint -p @tryghost/e2e ✅ Succeeded 5s View ↗
nx run-many --target=build --projects=tag:publi... ✅ Succeeded 1s View ↗

💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗


☁️ Nx Cloud last updated this comment at 2026-07-27 16:41:16 UTC

@kevinansfield
kevinansfield marked this pull request as ready for review July 27, 2026 16:40
@kevinansfield
kevinansfield requested a review from 9larsons as a code owner July 27, 2026 16:40
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