Skip to content

Conversation

@jennifer-shehane
Copy link
Member

@jennifer-shehane jennifer-shehane commented Oct 21, 2025

Additional details

Steps to test

How has the user experience changed?

PR Tasks


Note

Catches errors from before:browser:launch, rethrows as PLUGINS_RUN_EVENT_ERROR, updates messaging to reference the configuration file, and adds unit/snapshot test coverage.

  • Server:
    • Wrap plugins.execute('before:browser:launch', ...) in try/catch in packages/server/lib/browsers/utils.ts; end span and rethrow via errors.throwErr('PLUGINS_RUN_EVENT_ERROR', 'before:browser:launch', err).
    • Only extend launch options if a plugin result is returned.
  • Errors:
    • Update PLUGINS_RUN_EVENT_ERROR text to say "configuration file" instead of "plugins file" in packages/errors/src/errors.ts.
  • Tests:
    • Add unit tests for executeBeforeBrowserLaunch and extendLaunchOptionsFromPlugins in packages/server/test/unit/browsers/utils_spec.ts (success, error, and validation cases).
    • Update snapshots in packages/errors/test/__snapshots__/PLUGINS_RUN_EVENT_ERROR.ansi and system test snapshots to reflect new error messaging and behavior.

Written by Cursor Bugbot for commit 4c00287. This will update automatically on new commits. Configure here.

cursor[bot]

This comment was marked as outdated.

@cypress
Copy link

cypress bot commented Oct 21, 2025

cypress    Run #66864

Run Properties:  status check failed Failed #66864  •  git commit 4c002874fe: Merge branch 'develop' into fix-hang-in-before-browser-launch
Project cypress
Branch Review fix-hang-in-before-browser-launch
Run status status check failed Failed #66864
Run duration 26m 47s
Commit git commit 4c002874fe: Merge branch 'develop' into fix-hang-in-before-browser-launch
Committer Jennifer Shehane
View all properties for this run ↗︎

Test results
Tests that failed  Failures 1
Tests that were flaky  Flaky 11
Tests that did not run due to a developer annotating a test with .skip  Pending 1102
Tests that did not run due to a failure in a mocha hook  Skipped 4
Tests that passed  Passing 26754
View all changes introduced in this branch ↗︎

Warning

Partial Report: The results for the Application Quality reports may be incomplete.

UI Coverage  45.35%
  Untested elements 189  
  Tested elements 161  
Accessibility  97.98%
  Failed rules  4 critical   8 serious   2 moderate   2 minor
  Failed elements 101  

Tests for review

Failed  cypress/e2e/commands/window.cy.js • 1 failed test • 5x-driver-firefox

View Output

Test Artifacts
... > only logs once
    </td>
  </tr></table>
Flakiness  issues/28527.cy.ts • 1 flaky test • 5x-driver-electron

View Output

Test Artifacts
issue 28527 > fails and then retries and verifies about:blank is not displayed Test Replay Screenshots
Flakiness  e2e/origin/config_env.cy.ts • 1 flaky test • 5x-driver-inject-document-domain-chrome

View Output

Test Artifacts
cy.origin- Cypress.config() > serializable > overwrites different values in secondary if one exists in the primary Test Replay
Flakiness  commands/net_stubbing.cy.ts • 1 flaky test • 5x-driver-firefox

View Output

Test Artifacts
... > stops waiting when an xhr request is canceled
    </td>
  </tr></table>
Flakiness  commands/files.cy.js • 1 flaky test • 5x-driver-firefox

View Output

Test Artifacts
src/cy/commands/files > #readFile > retries to read when ENOENT
    </td>
  </tr></table>
Flakiness  e2e/origin/config_env.cy.ts • 1 flaky test • 5x-driver-firefox

View Output

Test Artifacts
cy.origin- Cypress.config() > serializable > overwrites different values in secondary if one exists in the primary
    </td>
  </tr></table>

The first 5 flaky specs are shown, see all 11 specs in Cypress Cloud.

@jennifer-shehane jennifer-shehane self-assigned this Oct 23, 2025

// Re-throw the error with proper context using the existing PLUGINS_RUN_EVENT_ERROR
errors.throwErr('PLUGINS_RUN_EVENT_ERROR', 'before:browser:launch', err)
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Telemetry Span Leak in Error Handling

Resource leak: The telemetry span is not properly ended if extendLaunchOptionsFromPlugins() throws an error. The try-catch block only wraps plugins.execute(), but extendLaunchOptionsFromPlugins() is called after the try-catch and can throw UNEXPECTED_BEFORE_BROWSER_LAUNCH_PROPERTIES. When it throws, the span started on line 138 will never be ended, causing a telemetry span leak. The try-catch should be extended to include the call to extendLaunchOptionsFromPlugins(), or a finally block should be used to ensure the span is always ended.

Fix in Cursor Fix in Web

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.

Errors thrown in before:browser:launch causes Cypress to hang when launching the browser

2 participants