Repository navigation
test(fix): wait for launch arguments in menu interaction tests - #86
Conversation
The menu interaction tests polled for about one second after each launch and then read the shim's marker file with a throwing call. On a loaded machine the shim took longer, so the read raised NSCocoaErrorDomain 260 at top level and the binary died with Trace/BPT trap 5. A shared helper now clears the marker, runs the launch and polls for up to 10 seconds until the menu has closed and the marker has content. The menu closes only after the launch process exits, so those two together mean the arguments are complete. A timeout reports a named expectation instead of an uncaught error. The two alert-toggle waits use the same bounded poll. The normal run still finishes in about 4 seconds. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to The updated waits have bounded completion checks, and the alert tests report which behavior failed. No issue identified here needs to block merging. Pre-merge checks |
|
Summary
MenuInteractionTestspolled for about 1 second after each launch (for _ in 0..<100 where !closed) and then read the shim's marker withtry String(contentsOf:). On a loaded machine the shim took longer than that, so the read threwNSCocoaErrorDomain Code=260at top level andtest/macos/menu-app-test.shdied withTrace/BPT trap 5. This pattern came in with #75.launchArguments(recordedIn:until:_:launch:)helper clears the marker, runs the launch, then polls every 10 ms for up to 10 seconds until the menu has closed and the marker has content. The menu closes only after the launch process exits, so both conditions together mean the arguments are complete. Clearing the marker first stops a wait from reading the previous launch's arguments.expectfailure (for example,a profile launch must dismiss the menu and record its arguments within 10 seconds) instead of an uncaught error.waitUntilwith the same 10-second bound.The change is test-only, so there is no CHANGELOG entry.
Verification
bash test/macos/menu-app-test.shpasses.make checkpasses (exit 0).sleep 2to the shim in scratch copies (not committed):Code=260 … "launch" couldn’t be opened.Fatal error: a profile launch must dismiss the menu and record its arguments within 10 seconds.🤖 Generated with Claude Code
Summary by CodeRabbit