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(electron): stalling on delayed process close #29431

Merged
merged 6 commits into from
Feb 13, 2024

Conversation

mxschmitt
Copy link
Member

@mxschmitt mxschmitt commented Feb 9, 2024

Investigation notes:

When we call ElectronApplication.close(), we return before the actual process has been exited. This can/will lead under certain timing conditions to that gracefullyCloseSet still has an entry.
When the worker then tries to exit, we call these entries, which will do options.attemptToGracefullyClose(). A recursive call to ElectronApplication.close() which will never resolve, due to the fact that we call BrowserContext.close again (good) but the actual close event will only be fired once. See here. This is why it was stalling for 30s.

Changes:

Based on that, I see 2 changes which we should do:

  1. Adjust ElectronApplication.close() so it can be called multiple times (like for a normal browser)
  2. Wait until the process has exited before returning from ElectronApplication.close() (like for a normal browser - Browser.close() -> gracefullyClose).

Fixes #27523

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

@mxschmitt mxschmitt merged commit 30557ed into microsoft:main Feb 13, 2024
17 checks passed
Copy link
Contributor

Test results for "tests 1"

7 flaky ⚠️ [chromium] › library/tracing.spec.ts:243:5 › should not include trace resources from the previous chunks
⚠️ [chromium] › library/tracing.spec.ts:243:5 › should not include trace resources from the previous chunks
⚠️ [chromium] › library/tracing.spec.ts:243:5 › should not include trace resources from the previous chunks
⚠️ [playwright-test] › ui-mode-test-ct.spec.ts:215:5 › should watch component via util
⚠️ [chromium] › library/tracing.spec.ts:243:5 › should not include trace resources from the previous chunks
⚠️ [webkit] › library/tracing.spec.ts:243:5 › should not include trace resources from the previous chunks
⚠️ [playwright-test] › ui-mode-test-ct.spec.ts:59:5 › should run component tests after editing test

26581 passed, 611 skipped
✔️✔️✔️

Merge workflow run.

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.

[REGRESSION]: electron tests sometimes freezes for 30 seconds
2 participants