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: preserve orphaned process electron #29515

Merged
merged 1 commit into from
May 20, 2024

Conversation

AtofStryker
Copy link
Contributor

@AtofStryker AtofStryker commented May 14, 2024

Additional details

This PR fixes an issue where orphaned processes were killing the whole electron browser CRI client, when in actually we want to preserve this until the electron process is terminated.

Unique to our electron setup, launching electron produces a window and not a separate browser instance. Since orphaned processes (or in this case, windows/targets) need to be cleaned up, we want to only clean up those items related to the process/window and not the overall launched instance.

see #28397 (comment) for more in depth details, as well as how we reproduced the issue

Steps to test

How has the user experience changed?

PR Tasks

@AtofStryker AtofStryker changed the title Fix/preserve orphaned process electron fix: preserve orphaned process electron May 14, 2024
@AtofStryker AtofStryker force-pushed the fix/preserve_orphaned_process_electron branch from da1febb to a900563 Compare May 14, 2024 16:05
Copy link

cypress bot commented May 14, 2024

11 flaky tests on run #55401 ↗︎

0 29194 1328 0 Flakiness 11

Details:

fix: preserve browser cri client in election if orphan process is detected [run ...
Project: cypress Commit: 6bdf6ed4a1
Status: Passed Duration: 19:27 💡
Started: May 14, 2024 7:44 PM Ended: May 14, 2024 8:03 PM
Flakiness  top-nav.cy.ts • 1 flaky test • app-e2e

View Output

Test Artifacts
... > dismisses the banner for a specified time Test Replay Screenshots
Flakiness  e2e/origin/navigation.cy.ts • 1 flaky test • 5x-driver-firefox

View Output

Test Artifacts
... > establishes foobar spec bridge
    </td>
  </tr></table>
Flakiness  e2e/origin/commands/waiting.cy.ts • 1 flaky test • 5x-driver-chrome

View Output

Test Artifacts
... > throws when foo cannot resolve Test Replay
Flakiness  commands/net_stubbing.cy.ts • 1 flaky test • 5x-driver-electron

View Output

Test Artifacts
... > stops waiting when an fetch request is canceled Test Replay
Flakiness  commands/querying/querying.cy.js • 1 flaky test • 5x-driver-electron

View Output

Test Artifacts
... > throws when alias property isnt just a digit Test Replay

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

Review all test suite changes for PR #29515 ↗︎

@AtofStryker AtofStryker marked this pull request as ready for review May 14, 2024 19:32

if (isOrphanedBrowserProcess) {
debug(`killing process because launch attempt: ${thisLaunchAttempt} does not match current launch attempt: ${launchAttempt}`)
await kill({ instance: _instance, isOrphanedBrowserProcess, nullOut: false })
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is nullOut (or rather !nullOut) serving the same purpose as isOrphanedBrowserProcess?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't think so. I think the goal of nullOut is to set the current browser instance to null, which we don't want to do since we want the active instance to be set, but the _instance inside the closure to be cleaned up.

@jennifer-shehane jennifer-shehane merged commit e39e748 into develop May 20, 2024
80 of 82 checks passed
@jennifer-shehane jennifer-shehane deleted the fix/preserve_orphaned_process_electron branch May 20, 2024 14:20
@cypress-bot
Copy link
Contributor

cypress-bot bot commented May 21, 2024

Released in 13.10.0.

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

@cypress-bot cypress-bot bot locked as resolved and limited conversation to collaborators May 21, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
4 participants