Skip to content

test(desktop): Keep WSL busy-runtime fixtures visible when sh is bash - #39

Closed
mwolson wants to merge 0 commit into
personal/clerk-token-file-modefrom
personal/wsl-busy-runtime-fixture
Closed

mwolson wants to merge 0 commit into
personal/clerk-token-file-modefrom
personal/wsl-busy-runtime-fixture

Conversation

@mwolson

@mwolson mwolson commented Sep 29, 2026

Copy link
Copy Markdown
Owner

What Changed

The executed WSL cache tests now hold a runtime busy, and hold an install lock, with processes that exit when the test script exits. Each test waits until its holder is in place before running the scripts under test.

Why

Two tests (removes an aged stale tree after replacing an active unready cache and prunes old and markerless caches without touching retained, active, locked, or unrelated roots) fail on hosts where /bin/sh is bash, such as Arch and Fedora. The fixture ran sh -c "sleep 30" <runtime>/t3. Bash runs a lone -c command in place of the shell, so the process's command line becomes just sleep 30. The prune and install scripts detect a busy runtime by scanning /proc/*/cmdline for its path, so they treated the "active" cache as idle and removed it. Production is unaffected, since a real server keeps its path in its command line.

The holders now use the runtime entry as their argv[0], and they read a pipe the test script keeps open, so nothing sleeps on a timer or outlives a test, including one that fails partway. With the in-use check deliberately broken, four tests fail; with the prune script ignoring install locks, the prune test fails.

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes
  • I included a video for animation/interaction changes

@mwolson
mwolson added this pull request to stack #38 September 29, 2026 16:25
@mwolson
mwolson force-pushed the personal/wsl-busy-runtime-fixture branch from 5d427a1 to 9560ced Compare September 30, 2026 12:58
@mwolson
mwolson force-pushed the personal/clerk-token-file-mode branch 2 times, most recently from cdd57b3 to e54148d Compare September 30, 2026 20:01
@mwolson
mwolson force-pushed the personal/wsl-busy-runtime-fixture branch from 9560ced to 4f375ba Compare September 30, 2026 20:01
@mwolson
mwolson force-pushed the personal/clerk-token-file-mode branch from e54148d to 8ef1920 Compare October 1, 2026 12:38
@mwolson
mwolson force-pushed the personal/wsl-busy-runtime-fixture branch from 4f375ba to 1778426 Compare October 1, 2026 12:38
@mwolson
mwolson removed this pull request from stack #38 October 1, 2026 12:39
@mwolson
mwolson added this pull request to stack #54 October 1, 2026 12:41
@mwolson
mwolson force-pushed the personal/clerk-token-file-mode branch from 8ef1920 to 510f127 Compare October 1, 2026 14:13
@mwolson

mwolson commented Oct 1, 2026

Copy link
Copy Markdown
Owner Author

Landed upstream as pingdotgg#14351 wsl-busy-runtime-fixture, which the fork's codex-turn-mapping pin now contains. Closing; the branch is kept.

@mwolson mwolson closed this Oct 1, 2026
@mwolson
mwolson removed this pull request from stack #54 October 1, 2026 14:13
@mwolson
mwolson deleted the personal/wsl-busy-runtime-fixture branch October 3, 2026 20:29
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.

1 participant