Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: report results correctly when the browser crashes mid-test #27786

Merged
merged 39 commits into from Oct 6, 2023

Conversation

cacieprins
Copy link
Contributor

@cacieprins cacieprins commented Sep 11, 2023

  • Closes

Additional details

This reports on tests that cannot be completed, focusing on the scenario where the browser renderer crashes during a test run. Reporting test runs correctly even when a spec causes the browser to crash is required to support test replay on those specs.

To this end, it:

  • patches the most recent run results when an exit-causing error is encountered
  • refactors crash handling logic out of run.ts

Future work, either on this branch or others, will include additional handling for various other scenarios where tests cannot be run.

Steps to test

How has the user experience changed?

PR Tasks

@cacieprins cacieprins marked this pull request as ready for review September 13, 2023 19:46
@cypress
Copy link

cypress bot commented Sep 13, 2023

6 flaky tests on run #51513 ↗︎

0 4479 942 0 Flakiness 6

Details:

Merge branch 'develop' into cacie/fix/report-results-on-crash
Project: cypress Commit: edbad0ec5b
Status: Passed Duration: 13:06 💡
Started: Oct 6, 2023 5:50 PM Ended: Oct 6, 2023 6:03 PM
Flakiness  commands/net_stubbing.cy.ts • 3 flaky tests • 5x-driver-webkit

View Output Video

Test Artifacts
network stubbing > intercepting request > can delay and throttle a StaticResponse Output
... > with `times` > only uses each handler N times Output
... > stops waiting when an xhr request is canceled Output
Flakiness  cypress/cypress.cy.js • 3 flaky tests • 5x-driver-webkit

View Output Video

Test Artifacts
... > correctly returns currentRetry Output
... > correctly returns currentRetry Output
... > correctly returns currentRetry Output

Review all test suite changes for PR #27786 ↗︎

@@ -376,7 +376,6 @@ export class ProjectBase extends EE {
},

onMocha: async (event, runnable) => {
debug('onMocha', event)
Copy link
Member

Choose a reason for hiding this comment

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

was this debug too spammy?

import type { Browser } from '../browsers/types'
import * as printResults from '../util/print-run'
import type { ProtocolManager } from '../cloud/protocol'
import { telemetry } from '@packages/telemetry'
import { CypressRunResult, createPublicBrowser, createPublicConfig, createPublicRunResults, createPublicSpec, createPublicSpecResults } from './results'
import { EarlyExitTerminator } from '../util/graceful_crash_handling'
Copy link
Member

Choose a reason for hiding this comment

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

@cacieprins cacieprins merged commit 1a6f879 into develop Oct 6, 2023
80 of 82 checks passed
@cacieprins cacieprins deleted the cacie/fix/report-results-on-crash branch October 6, 2023 18:45
ryanthemanuel added a commit that referenced this pull request Oct 11, 2023
)

* chore: fix problem introduced by <pr>

* Update packages/server/lib/modes/run.ts
@cypress-bot
Copy link
Contributor

cypress-bot bot commented Oct 11, 2023

Released in 13.3.1.

This comment thread has been locked. If you are still experiencing this issue after upgrading to
Cypress v13.3.1, please open a new issue.

@cypress-bot cypress-bot bot locked as resolved and limited conversation to collaborators Oct 11, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants