Repository navigation
fix(test): close the measured window without quitting installed apps - #118
Merged
Merged
Conversation
measure-cpu.sh closed the test build's window with an AppleScript quit. AppleScript finds apps by bundle identifier, so it also quit an installed Chargectl, which stops its helper and hands charging back to macOS. Close the window with a chargectl://dashboard/close link that only --background builds answer, opened with the measured app.
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
scripts/measure-cpu.shmeasured "window closed" by telling the test app to quit through AppleScript. AppleScript picks apps by bundle identifier, so the quit also reached the installed Chargectl. On this Mac that quit it twice today (helper log: "Chargectl quit; macOS manages charging until it opens again" at 4:39 PM and 9:38 PM), stopping the helper until the app was opened again.The script now opens
chargectl://dashboard/closewith the measured app, as it already does for pages. Only Debug builds started with--backgroundanswer that link, by closing the dashboard.Verified
./scripts/check.shpasses../scripts/measure-cpu.shon M3 MacBook Air, macOS 27.2.1: the installed Chargectl kept running (same process), the helper logged nothing, and "window closed" read 0.2%, so the test window did close.