Repository navigation
Fix the races behind five tests that fail on unrelated pull requests - #19096
Merged
Merged
Conversation
omarchy-kernel compared menu entries through printf | grep -q under pipefail, so an early match could SIGPIPE printf and read as a miss. The privileged environment sanitizer waited on a process substitution Bash could already have reaped; it now reads a lastpipe pipeline and takes env's status from PIPESTATUS, failing closed with job control on. The screen recording test let a pending start's shortened ready timeout run out before the toggle arrived, the thumbnail test checked for files before generate_thumbnail moved them into place, and the router timing read a wall clock that time sync steps right after the CI VM boots. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
[Medium impact] The PR appears safe to merge; no actionable issues were found. SummaryFixes two command races and makes three test waits more reliable.
No actionable issues found. Tests were not run during this review. Author Reviews (1) · Last reviewed commit: "Fix the races behind five tests that fai..." · Reviewed by Greptile |
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.
Five tests fail on pull requests that do not touch their code, and pass when the run is repeated. Each has a cause that a busy CI VM exposes, and two of those causes are in the commands rather than the tests.
omarchy-kernelcan read a matching kernel as a miss.omarchy-kernel-test.shfailed "the previous menu leader is rebuilt" on run 43650062736 (#18951) and "the kernel that led the menu is restored, though get could not name it" on 43508555148 (#18821).first_menu_kernelchecked each menu entry withprintf '%s\n' "${kernels[@]}" | grep -Fxq. Bash writes each of printf's lines separately, so when the entry matches an early kernel, grep can exit before the rest are written; printf then takes SIGPIPE, andpipefailturns the match into a miss. The function goes on to name a later kernel, so a failed switch can decide the old kernel already leads the menu and skip rebuilding it. The entry is now compared in Bash. Under load on a worker the test failed 7 of 200 runs onquattroand 0 of 200 with this change.A privileged helper can refuse to run because
waitlost its child.update-stay-awake-security-test.shfailed "concurrent start and stop are serialized", afterwait: pid … is not a child of this shell, on 43519859663 (#18795).omarchy_security_sanitize_bash_environmentreadenv -0through a process substitution and then waited on its pid for env's status. Bash can reap a finished process substitution before thatwait, which then fails, and the helper exits without doing anything. The environment is now read through a pipeline underlastpipe, so the loop still fillsunsetsin this shell, and env's status comes fromPIPESTATUS.lastpipedoes nothing with job control on, so the function fails closed there rather than sanitizing nothing. Called 48,000 times under load, the function failed 4 times onquattroand never with this change, and it still stripsBASH_FUNC_*,BASH_ENV,PS4andCDPATHbefore re-executing.The screen recording toggle could arrive after the pending start had given up.
screenrecording-concurrency-test.shfailed "a toggle during a pending start does not begin another recording" on 43735030677 (#18806) and passed on rerun. The test shortens the start's 0.2s ready poll to 0.05s, which also shortens its 75-tick ready timeout to under four seconds. A toggle that reaches the lock after that finds no start in progress and begins a recording of its own. The stub now keeps a start whose recorder never becomes ready waiting until a toggle or stop leaves its cancel request, or the start itself is gone, so the toggle always meets the pending start it is testing. Holding the toggle back four seconds reproduces the CI failure onquattro, and the test passes that way with this change.The thumbnail check could run before the thumbnail was in place.
menu-images-test.shfailed "lazy image menu retains new and changed jobs while its pool is busy" on 43507843783 (#18793) and on the translation sync's run 43557709833. The stub converter records its conversion before it exits, andgenerate_thumbnailmoves the output to its cached name only after that, so the test could count all 42 conversions and look for a file that was a moment away. The wait now also waits for the two thumbnails it checks. Delaying the stub's exit by 0.1s fails onquattroevery time and passes with this change.The router timing read a clock that time sync steps.
test/clifailed "an alias dispatch costs a fraction of loading the whole command table" on 43520043860 (#18816) and onquattroin 43762244320, where loading the whole table for help took 7ms and 40ms against its usual 400ms.test/cliruns in the first minute after the CI VM boots, which is when systemd-timesyncd makes its first synchronization: 32 seconds into a worker's boot, with systemd-resolved logging the clock change.EPOCHREALTIMEfollows that step, so one of the five help timings came out near zero. The timings now read/proc/uptime, which counts from boot; its 10ms resolution is fine against a fourfold margin on a few hundred milliseconds. With the clock stepped back during the run, the old timing reports help at -279ms and fails, and the new one passes.Left alone here:
dropdown-test.sh, "dropdown popup fits short lists and preserves capped scrolling", is the most frequent of all (six of the last 50 failed runs, among themquattropushes 43503794578, 43720716849 and 43754051236, and the first attempt of 43735138887 for Print usage for omarchy-notification-send --help instead of sending a notification #18819, which passed on rerun), and this does not fix it. The report from Report what the dropdown test sees when its keyboard walk stalls #18872 shows the test's own window losing activation partway through the keyboard walk (winActive false afi null), so the key presses go nowhere. On the offscreen platform a window loses activation only when another window in the process is shown or activated, or the focused one is destroyed. The test did not fail once in 136 runs on workers: under load, in the desktop session's environment with fcitx5's input context loaded, and while fcitx5 reloaded, restarted and switched input methods. Its cause is not established, so this change does not guess at one.i18n-startup-test.shfailed on unrelated pull requests until Watch translation files before rereading them, so no change is lost #18734 fixed the race behind it, and has not failed since.lock-appear-budget-test.shmissed its 2720ms budget once (43702321635, Drop the N1x rescue boot entry #18913, passed on rerun). That is a performance budget, and how much room it has is a decision for whoever set it.shell-idle-spawn-test.sh(43766749323) andmanifest-entrypoints-test.sh(43754104425) each failed once when the quickshell under test was killed with SIGKILL. Neither run's kernel log records an OOM kill, and neither has recurred.Reviewed by Codex Medium, which found nothing to change and agreed with each cause; it reads from the machine this was written on, so its agreement is not an independent check.