Repository navigation
Backport the shell test fixes to v4-5-0 - #17390
Conversation
…#16859) The transparent bar check from #8307 sets the bar's background with omarchy-bar, which edits shell.json from outside the shell. Elsewhen saves its first-run cities once its timezone probe returns, and that save writes the shell's whole in-memory config back to shell.json. When the probe returns after the edit, the file goes back to an opaque bar, the bar never turns transparent and nothing samples the wallpaper. On a desktop the probe returns before the test gets there. In a VM it returned later in 7 of 8 runs: the file read "background": "opaque" with Elsewhen's cities saved, 30 s after omarchy-bar had reported "Bar background set to none". The unreadable shell.json checks further down already waited for that save. The wait is now one helper, called before both edits, and allows 30 s, since it returns as soon as the cities are saved. (cherry picked from commit 63b6e5b)
The live probe edits files the shell watches: the catalogs, the
language selection and the plugin directory. It wrote them in place,
which truncates first, and Quickshell's FileView reloads on the
change, so a reload between the truncation and the write reads an
empty file. With an empty catalog or plugin directory,
t("test.hello") returns its key and .arg("Ada") logs "QString::arg:
Argument missing", which fails the final log check. CI hit this on a
loaded runner.
Write each file beside its target and rename it over, so a reload
reads either the old file or the new one.
In a VM with every vCPU kept busy, the test failed 10 of 40 runs on
that warning before this change and 0 of 40 after. Renaming only the
catalogs was not enough (13 of 40 failed): the language and plugin
directory files are watched too.
(cherry picked from commit e6c6a18)
…6887) The test starts sleep with FCITX_CONFIG_HOME set and at once reads the profile path from that process's /proc environ. Popen returns when the child's close-on-exec pipe closes, early in the kernel's exec, but the new environment is readable only once create_elf_tables sets env_end (fs/binfmt_elf.c). Until then the read is empty (fs/proc/base.c), refused, or the parent's, so the lookup falls back to the caller's own $HOME and the assertion fails on /home/<user>/.config/fcitx5/profile, as it did in CI. On a 7.2 kernel, 842 of 2000 reads made right after Popen returned lacked the child's environment, which appeared p50 26 us and p99 44 us later. With the test's VM pinned to one host core, as vCPUs share a core on a busy runner host, the test failed that way in 12 of 150 runs before this change and 0 of 150 after. A real Fcitx owns its bus name long after its exec, so the shell's lookup is unaffected; only the test needs to wait. (cherry picked from commit 79dcccf)
agent-account-exec-test pointed mise at all of etc/mise, so the agents were declared lazy tools. Current mise installs a declared lazy tool before running its wrapper, so offline the test failed fetching claude@latest before it reached the fake CLI. Give it only the wrapper declarations. mise also refuses a wrapper whose tool has no binary, so the first-run install cases now call omarchy-agent-account-exec the way mise hands off to it, with the wrapper directory off PATH. The quattro commit also fixed the dropdown test, which v4-5-0 doesn't have yet; that half goes with the backport that brings the test. (cherry picked from commit 0a54d6f) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CY6YBoMt9VUxZ6fJqSXaj1
The fixture cleanup killed Quickshell and removed its scratch HOME, but the processes Quickshell had started (the agent usage scanner, the plugin directory's inotifywait) outlived it. The scanner could still be writing into home/.cache while rm -rf ran, so cleanup failed with "Directory not empty", and since that rm was the trap's last command, set -e failed a test whose checks had all passed. The watchers were left running against deleted directories after every run. Stop the whole process tree, and retry the removal briefly for a child caught mid-write. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CY6YBoMt9VUxZ6fJqSXaj1 (cherry picked from commit 63fd018)
The pi scanner counts a reply once per id and timestamp, as a real repeated entry carries both. The test built its repeated a-1 reply with two reply() calls, each stamping fixture_now() to the millisecond, so when the clock ticked between them they were two replies and today's minimax-m3 tokens came out doubled (1850 for 925). Under the full suite that happened often enough to fail. Build the entry once and write it twice. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CY6YBoMt9VUxZ6fJqSXaj1 (cherry picked from commit 93e3b0a)
[Low impact] The PR appears safe to merge; the previous fixture cleanup issue is fixed. SummaryBackports shell test fixes to
The previous cleanup finding is fixed. No new actionable issues were found. Reviews (2) · Last reviewed commit: "Stop a crashed QML fixture's children th..." · Reviewed by Greptile |
| mapfile -t tree < <(qml_fixture_tree "$QML_FIXTURE_PID") | ||
| kill "${tree[@]}" 2>/dev/null || true |
There was a problem hiding this comment.
Crashed fixtures leave children running
qml_fixture_cleanup still skips child cleanup if Quickshell has already crashed, such as after a compositor disconnect. The kill -0 check fails, so the new tree walk never runs. The plugin-registry fixture starts a persistent inotifywait, and its QML cleanup cannot cover crashes. Failed runs can therefore leave background processes behind.
Track fixture processes independently of the live parent, using a unique fixture marker or process group, so cleanup also covers crashes.
There was a problem hiding this comment.
Fixed in fcf4bd8. Each fixture's Quickshell now starts with setsid and leads its own process group. Cleanup (and a second fixture replacing the first) signals that group instead of walking down from a live Quickshell, so children left to init after a crash are still stopped. To check, I SIGKILLed the manifest fixture's Quickshell: its inotifywait stayed in the group, and cleanup stopped it. The full suite passes (403/403) with no inotifywait left behind.
Fixture cleanup found Quickshell's children by walking down from a live Quickshell, so once Quickshell had crashed (a compositor disconnect, say) the walk never ran and its children, such as the plugin directory's inotifywait, were left to init. Start each fixture's Quickshell in a process group of its own with setsid and signal the group, which works whether or not its leader is still alive. A second fixture in the same file stops the first the same way. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CY6YBoMt9VUxZ6fJqSXaj1
Backports the shell test fixes from #17388 to
v4-5-0, along with three test fixesquattroalready had. Before this,./test/shellonv4-5-0failed 3 to 5 files per run. With it, all 403 pass.From
quattroruntime-smoke-test.sh, which failed every run onv4-5-0with "transparent bar samples the wallpaper when turned on": Elsewhen's first save wrote the old config back over the test's edit. It needed a hand merge. The unreadable-shell.json section ofv4-5-0's copy used$test_home,$QS_PID,$TMPDIRandshell_ipc, none of which exist on this branch. The race had kept the test from ever reaching that section, so it would have died next with "unbound variable". The file now matchesquattro's exactly.From #17388
agent-account-exec-test.shoff the network. It failed every run: with the agents declared lazy tools, current mise tries to installclaude@latestbefore running the wrapper. Fix the shell tests that fail on a desktop run #17388 also fixes the dropdown test, whichv4-5-0doesn't have yet. That half is in Backport 44 bug fixes from quattro to v4-5-0 #17386, which brings the test.rm -rf, andinotifywaitwatchers were left running after every run.quattroseparately, since Fix the shell tests that fail on a desktop run #17388 has already merged.config-test.shalso fails when the local omarchy-pkgs checkout is out of date. That's an environment issue: current omarchy-pkgsmasterandrcpass it.Testing
./test/shellwithOMARCHY_PKGS_PATHat current omarchy-pkgsmaster: all 403 files pass, and noinotifywaitorphans are left behind.🤖 Generated with Claude Code
https://claude.ai/code/session_01CY6YBoMt9VUxZ6fJqSXaj1