Skip to content

test(desktop): separate the notch launch budget from its behaviour - #1347

Merged
nixuuu merged 1 commit into
devfrom
test/desktop-notch-flake-root-cause-and-fix
Nov 27, 2026
Merged

nixuuu merged 1 commit into
devfrom
test/desktop-notch-flake-root-cause-and-fix

Conversation

@nixuuu

@nixuuu nixuuu commented Nov 27, 2026 •

Copy link
Copy Markdown
Member

Changes

  • Root cause: the test sent SIGKILL 35 s after spawning Electron, but the fixture's 25 s watchdog only started once its main script ran. When a cold Electron launch on the Intel macOS runner took more than 10 s, the outer kill fired first. The failure then had no stage, only Electron exited with SIGKILL. The pinned Electron download and the AppKit addon build also counted against the same test timeout. Passing darwin-x64 runs took anywhere from 11 s to 48 s. Two diagnostic CI runs of this branch on darwin-x64 showed the launch to the first page load varying from 3.7 s to 8.5 s, while the behaviour after it took about 5 s both times.
  • The bundles, the native addon and the Electron download now run in beforeAll, outside the Electron budgets.
  • The fixture prints each stage and an Activity notch launched marker after the first page load. Its 25 s watchdog now starts at that marker.
  • The test reads stdout line by line and timestamps each line from the spawn. Launch gets 60 s and the behaviour after it gets 35 s, which backs up the fixture's watchdog if app.exit hangs. A failure reports the stalled phase and the full stage timeline. After a kill, a helper process that still holds stdout can delay the result by at most 3 s.
  • docs/desktop.md describes the two budgets and the timeline.

Verification

  • Desktop typecheck, oxlint and oxfmt on the edited files passed.
  • I ran the harness on Linux with a fake Electron script. It passed a clean exit, reported the fixture's assertion lines, reported did not launch for a hang before launch and did not finish after launching for a hang after it, and released a pipe held by a leftover child within the grace period.
  • A temporary diagnostic commit printed the stage timeline in this PR's CI: darwin-x64 (two runs), darwin-arm64 and windows-x64 all passed. It has been removed from the final commit.
  • The macOS native check in CI is the real verification. A launch slower than 60 s, the case that originally failed, cannot be reproduced on demand.

Copy audit: no UI text changed.

Related: #1281

🤖 Generated with Claude Code

The macOS activity notch test killed Electron 35 s after spawning it,
while the fixture's own 25 s watchdog started only once the main script
ran. A cold Electron launch on an Intel runner that took over 10 s let
the outer SIGKILL win, so the failure carried no stage. The Electron
download and native addon build also ran inside the same test timeout.

Build the bundles, the addon and the pinned Electron download in
beforeAll. The fixture now prints each stage and a launched marker after
the first page load. The test timestamps every line from the spawn and
gives the launch 60 s and the behaviour after it 35 s, backing the
fixture's 25 s watchdog, which now starts at launch. Failures report the
stalled phase and the stage timeline, and a helper holding stdout after
a kill no longer delays them.

Related: #1281

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@nixuuu
nixuuu force-pushed the test/desktop-notch-flake-root-cause-and-fix branch from 6224726 to 1819315 Compare November 27, 2026 16:38
@nixuuu
nixuuu marked this pull request as ready for review November 27, 2026 16:38
@nixuuu
nixuuu enabled auto-merge (squash) November 27, 2026 16:38
@nixuuu
nixuuu merged commit 55b9168 into dev Nov 27, 2026
26 checks passed
@nixuuu
nixuuu deleted the test/desktop-notch-flake-root-cause-and-fix branch November 27, 2026 16:43
nixuuu added a commit that referenced this pull request Nov 29, 2026
## Changes

- Scope diagnostics assertions to their own SQL operations. Wait for the
gateway to record the active turn before exercising bot connector rules.
- Keep the checkout-alias lock fixture running through the rejection
assertion. Track unique start commands and their acknowledgements after
a worker restart, including when the link redelivers a command.
- Preinstall and cache the pinned Electron binary before the native
window test. Retry the install step on failure. Use the artifact
downloader with interrupted-transfer retry and digest validation for
native binaries.
- List the first failed step and Bun test names from attempt 1. Report
missing log downloads explicitly.

The old skill-preview and linked-mirror failures already have fixes on
`dev`. The earlier notch timeout also has separate launch and behavior
budgets. This PR moves the Electron download out of that test's setup.
#1341, #1412, #1347

## Verification

- `check:tmp` on the four affected integration files and the recovery
script test passed all 36 tests. The four flaky cases and two recovery
cases also passed 12 consecutive runs each.
- Focused lint, formatting, Bash syntax and diff checks passed.
Replaying the reporter against a real failed test and a real artifact
failure produced the expected entries without posting comments.
- PR CI covers the full gate and the native macOS/Windows checks. The
automatic recovery workflow itself runs after Push CI on protected
branches.

Closes #1346
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.

1 participant