Skip to content

Ensure CSP check always tears down Chrome when startup fails#33816

Closed
Copilot wants to merge 1 commit into
26_1from
copilot/fix-code-review-suggestion
Closed

Ensure CSP check always tears down Chrome when startup fails#33816
Copilot wants to merge 1 commit into
26_1from
copilot/fix-code-review-suggestion

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Jun 3, 2026

This PR addresses the specific review comment about orphaned Chrome processes in the CSP checker. If startBrowser() throws before the check loop begins, cleanup now still executes.

  • Scope

    • Applies only the requested fix in apps/demos/utils/server/csp-check.js for review comment discussion_r3347213638.
  • Change

    • Moved browser startup into the existing try block in main().
    • This guarantees stopBrowser() in finally runs even when startup fails.
  • Behavior impact

    • Prevents leaked Chrome processes on debugger/bootstrap failures.
    • No functional changes to the normal CSP-check execution path.
try {
  await startBrowser();
  await runPool(...);
} finally {
  stopBrowser();
}

Copilot AI changed the title [WIP] Fix code based on review comments Ensure CSP check always tears down Chrome when startup fails Jun 3, 2026
Copilot AI requested a review from EugeniyKiyashko June 3, 2026 09:19
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.

2 participants