fix(playwright): make context cleanup idempotent - #1859
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 49728dfa52
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Rsdoctor Bundle Diff AnalysisFound 13 projects in monorepo, 1 project with changes. 📊 Quick Summary
📋 Detailed Reports (Click to expand)📁 playwrightPath:
📦 Download Diff Report: playwright Bundle Diff Generated by Rsdoctor GitHub Action |
…ed failure When context.close() throws during onTestFinished for an otherwise passing test, the runner marks the test failed only after the cleanup promise rejects, then invokes onTestFailed. The cached rejected promise must still trigger finishContextCleanup(false) so retain-on-failure traces are promoted from staging and the retained browser is released.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 12ab2f5a71
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 190bbe98a4
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Summary
context.close()fails before the runner marks the test failedThe existing context-close failure regression test exercises the re-entrant cleanup path.
This fixes cleanup races and failure-path resource handling. It does not claim to cancel arbitrary Playwright promises after a generic test timeout; Playwright APIs do not expose a common cancellation mechanism for that case.
Validation
rslint packages/playwright/src/fixture.tspassedgit diff --checkpassedfinalizes Playwright trace when context close failscore.hooksPathand pnpm symlink setup