Skip to content

Backport the shell test fixes to v4-5-0 - #17390

Merged
dhh merged 7 commits into
v4-5-0from
backport/v4-5-0-shell-test-fixes
Nov 2, 2026
Merged

dhh merged 7 commits into
v4-5-0from
backport/v4-5-0-shell-test-fixes

Conversation

@omarchybot

@omarchybot omarchybot commented Nov 2, 2026 •

Copy link
Copy Markdown
Collaborator

Backports the shell test fixes from #17388 to v4-5-0, along with three test fixes quattro already had. Before this, ./test/shell on v4-5-0 failed 3 to 5 files per run. With it, all 403 pass.

From quattro

From #17388

  • Keep agent-account-exec-test.sh off the network. It failed every run: with the agents declared lazy tools, current mise tries to install claude@latest before running the wrapper. Fix the shell tests that fail on a desktop run #17388 also fixes the dropdown test, which v4-5-0 doesn't have yet. That half is in Backport 44 bug fixes from quattro to v4-5-0 #17386, which brings the test.
  • Stop a QML fixture's child processes along with its Quickshell. The agent-usage scanner kept writing into the fixture's HOME during rm -rf, and inotifywait watchers were left running after every run.
  • Stop a crashed QML fixture's children through its process group. This came from Greptile's review here: each fixture's Quickshell now leads its own process group, so cleanup still reaches its children after Quickshell itself has crashed. The same change goes to quattro separately, since Fix the shell tests that fail on a desktop run #17388 has already merged.
  • Stamp the Kimchi test's repeated reply once. Its two "repeated" entries could get timestamps a millisecond apart, so they counted as two replies and doubled today's tokens.

config-test.sh also fails when the local omarchy-pkgs checkout is out of date. That's an environment issue: current omarchy-pkgs master and rc pass it.

Testing

./test/shell with OMARCHY_PKGS_PATH at current omarchy-pkgs master: all 403 files pass, and no inotifywait orphans are left behind.

🤖 Generated with Claude Code

https://claude.ai/code/session_01CY6YBoMt9VUxZ6fJqSXaj1

emirb and others added 6 commits November 2, 2026 21:43
…#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)
@greptile-apps

greptile-apps Bot commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Low impact] The PR appears safe to merge; the previous fixture cleanup issue is fixed.

Summary

Backports shell test fixes to v4-5-0.

  • Agent account tests reach the fake CLI without fetching real tools.
  • Repeated Kimchi replies use one exact timestamp.
  • QML fixture cleanup stops child processes before removing scratch files.
  • The i18n test replaces watched files in one step.
  • The Fcitx profile test waits for its fake process to start.
  • The smoke test waits for Elsewhen before editing shell settings.

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

Comment thread test/shell.d/base-test.sh Outdated
Comment on lines +148 to +149
mapfile -t tree < <(qml_fixture_tree "$QML_FIXTURE_PID")
kill "${tree[@]}" 2>/dev/null || true

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 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.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
@dhh
dhh merged commit e9d8b30 into v4-5-0 Nov 2, 2026
2 checks passed
@dhh
dhh deleted the backport/v4-5-0-shell-test-fixes branch November 2, 2026 22:11
@emirb emirb added this to the 4.5 milestone Nov 5, 2026
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.

4 participants