Repository navigation
fix(desktop-e2e): remove root causes of four retry-masked desktop flakes - #8940
Conversation
- packaged-smoke: remove the profile only after every process that can write it (the app's process group, Crashpad's handler) is gone; SIGKILLing main left helpers creating files during rmSync (ENOTEMPTY) - background-executor: answer shell dialogs by waiting for their window to close, since the dialog destroys itself before the click is acknowledged - background-executor A: replace the 1.5 s p95 wall-clock threshold with a gated check that every call is claimed while chat B's first command still holds its queue, within Sim's 15 s pickup window, and that held leases renew - driver: a click whose tab closes itself mid-dispatch (popup Allow -> window.close()) is a dispatched click, not a failed one, whichever of the close and the input acknowledgement lands first - page-dialogs / browser-focus / browser-tools: print the tool error and the shown dialog id when they fail, to root-cause the remaining flakes
…hat then closed - cdp.clickAt raises TabClosedOnReleaseError only when the final mouseReleased was sent to a live tab and the tab is destroyed when it rejects; the driver rescues only that error (no string match, no pre-input/press/hold cases), with a note that does not claim the page closed itself and doNotRetry - background-executor A: assert each call is claimed within Sim's 15 s pickup window measured from issue, and always release the gated commands
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
There was a problem hiding this comment.
All reported issues were addressed across 8 files
Heads up: you’ve reached your flex budget. Increase your flex budget or wait for usage to reset.
Turn on auto-fix | Re-trigger cubic
|
The tab being destroyed proves teardown, not that Chromium processed the release, so the rescued result no longer claims effectObserved and its note says the outcome could not be confirmed. Adds clickAt tests for each TabClosedOnReleaseError guard and a driver test for the rescued shape.
|
@cubic-dev-ai review this PR |
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
There was a problem hiding this comment.
No issues found across 10 files
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
Heads up: you’ve reached your flex budget. Increase your flex budget or wait for usage to reset.
Turn on auto-fix | Re-trigger cubic
Summary
Desktop Playwright retries once in CI, so flakes never show up as failures. In 143 recent runs, 8 green runs in gating jobs passed only on the retry. This PR fixes four of those flakes at their root and adds diagnostics for the other three.
Fixed
packaged-smoke:91(also gates releases) and the same race at:46. Cleanup deleted the profile (userData) folder while the app's leftover helper processes, such as Crashpad's handler, could still write to it, which causedENOTEMPTY. The app now launches in its own process group. Cleanup waits, with a bounded poll, until no process in that group or naming the unique temp profile path is left, then deletes the folder.background-executor:253. The consent dialog closes its own window before Playwright gets the click acknowledgement, so the click fails even though the answer landed. A newanswerShellDialoghelper waits for the window to close instead. Each caller still asserts the recorded outcome.background-executor:83. This checked a 1.5s wall-clock limit on a shared runner, while the product's real pickup deadline is 15s (repository.ts:58,constants.ts:79). The test now asserts that every call is claimed within 15s of being issued, holds the first command so lease renewal is checked, and releases that hold in afinally. Fast pickup is still asserted in test F.browser-tools:609, a real product bug. When a click makes a page close its own tab (for example a popup's Allow button), Electron can reject the finalmouseReleasedafter the tab is gone. The driver then reported "Native click dispatch failed" for a click that had landed.cdp.clickAtnow raises a typedTabClosedOnReleaseErroronly when the final release went to a live tab and that tab is destroyed by the time the release is rejected. The driver treats only that error as a delivered click, returningtabChangedanddoNotRetry. Any failure before input, or on the move, press or hold, keeps its existing error.Diagnostics only (
browser-page-dialogs:46,browser-focus:32): failures now print the tool error and the dialog id, so the next flake names its cause.smoke:85, a hang inapp.close(), needs aDEBUG=pw:browserrun.Playwright still retries once.
failOnFlakyTestsgets enabled once the remaining three are fixed.Test plan
desktop-live/desktop-e2egreen, with no "flaky" lines for the four fixed specs