Repository navigation
CI(fix): Repair the advisory macOS trial - #9
Merged
Merged
Conversation
tony
force-pushed
the
flaky-investigations-000
branch
6 times, most recently
from
October 10, 2026 17:39
6cc86a5 to
4b84426
Compare
tony
force-pushed
the
flaky-investigations-000
branch
6 times, most recently
from
October 10, 2026 21:17
8001ad3 to
7bc2d9a
Compare
why: tmux reads a pane's directory from the kernel, which answers /private/tmp for /tmp on macOS. A host script's /bin/sh does the same for $PWD when it starts in a directory it did not inherit. WorkspaceCorpus, WorkspaceApply and the workspace guide compared these with the unresolved fixture path and failed on every hosted macOS cell without naming the condition. With the fixture base set to a symlink to a real directory, each fails on its path assertion before this change and passes after it; each also passes without the override. what: - Move Resolve-PhysicalDirectory from Create.Tests into OwnedTmux.ps1. - Resolve the expected directory per assertion in WorkspaceCorpus, WorkspaceApply and GuideExamples. The shared fixture root stays as created. - Let LIBTMUX_POWERSHELL_TEST_ROOT replace the /tmp fixture base so a symlinked base reproduces the macOS mismatch on Linux.
why: The advisory trial and the optional stress runs need the same locked module packages and pinned tools. what: - Share the package build and macOS tool setup between workflows. - Keep the trial matrix, its reports and its advisory suite outcomes.
why: Repeating each installed suite exposes failures that a single hosted run can miss. what: - Dispatch stress runs on macOS arm64 and Ubuntu with the same tmux and PowerShell versions. Allow a suite subset and repetition count. - Collect each suite's receipts and report per-test failures, timeouts and elapsed times with PowerShell.
why: Tests that pass on Linux fail on the hosted macOS runners for a short list of reasons. Contributors need them before writing a test. what: - Add MACOS_CI.md with the rules and how to reproduce each on Linux. - Name this repository's helpers and workflows at the end. - Link it from CONTRIBUTING.md.
why: Fixture setup waits for the foreground tmux daemon's socket, the only readiness signal tmux -D gives: tmux loads its config only when a first client connects, so no config command can report. The FileSystemWatcher used for that signal is built on FSEvents on macOS, which never reports a Unix socket, so setup fell back to two probes inside one second and missed slow daemons. A kqueue NOTE_WRITE watch on the directory fires when bind() adds the socket. bind() runs just before listen(), so a refused connect after the event is retried across that window only. On the hosted macOS runners the watch reported the socket of tmux -D 46 to 226 ms after start, and disposing a watch with no socket returned in under 1 ms. what: - Watch the fixture directory with kqueue on macOS and keep the FileSystemWatcher on Linux. - Wait for the signal or the daemon's exit, then for an accepted connection and the daemon's identity, under a one second hang guard. - Delete the replaced daemon's socket file before watching for the new one, because tmux leaves it at exit (server.c only unlinks before bind); a stale file signalled at once and failed to connect. - Use the real signal in the Remove replacement test, replace the silent-watcher fixture tests with one that binds a socket in a watched directory, and keep the timeout diagnostics test at 50 ms. refs: - https://github.com/tmux/tmux/blob/3.7c/server.c#L107-L150 - https://github.com/tmux/tmux/blob/3.7c/server.c#L121 - https://github.com/tmux/tmux/blob/3.7c/server-client.c#L2572-L2581 - https://github.com/libtmux/libtmux-powershell/actions/runs/38078677139
why: WorkspaceCorpus and the Lifecycle guide still fail on macOS after the fixture paths are resolved, for two Darwin userland reasons. /etc is a symlink to /private/etc, so the kernel reports a different pane path. /bin/sh is bash, so pane_current_command reads bash. what: - Resolve /usr and /etc before comparing them with pane paths. - Accept sh or bash for the pane command of the shell window guide.
why: The owned-rename example created its socket under the platform temp directory. macOS TMPDIR is about 50 bytes, so the socket path passed the 104 bytes sun_path holds and tmux failed with "File name too long". The Documentation suite failed in the OperationsInteraction guide on the hosted Intel cells. With TMPDIR set to an 85 byte directory the Guides suite fails with the same error before this change and passes after it. what: - Create the example's private directory under /tmp in the guide script and in docs/watch.md, and say why.
why: python3 -m http.server prints its address only after HTTPServer.server_bind resolves the bound host with socket.getfqdn. On the hosted macOS runner that reverse lookup of 127.0.0.1 blocks for 35 s in setup-python 3.13.15, Homebrew 3.14.7 and python.org 3.14.7, while Apple's /usr/bin/python3 3.9.6 answers in 0.05 s. The wait ends first, so the README and guide tests timed out in every macOS cell and in all 10 macOS stress repetitions. A longer wait would pass but spend 35 s per run; socketserver.TCPServer binds without the lookup and printed its line in 0.19 s on the same runner. what: - Start the example's server with socketserver.TCPServer and SimpleHTTPRequestHandler, printing the line the wait already matches, in the README, docs/input.md and examples/Guides.ps1. - Add the reverse-lookup rule to MACOS_CI.md. refs: - https://github.com/python/cpython/blob/v3.13.15/Lib/http/server.py#L138-L143 - https://github.com/python/cpython/blob/v3.13.15/Lib/socket.py#L797-L821 - https://github.com/libtmux/libtmux-powershell/actions/runs/38066913812
why: The event-driven watcher can miss a notification while the owned tmux process has a usable socket. what: - Keep the socket notification fast path and probe an existing socket when the watcher is silent. Both paths verify the owned daemon PID. - Share the readiness deadline across the notification, connection, and PID waits. Exercise startup and replacement with a silent watch.
tony
force-pushed
the
flaky-investigations-000
branch
from
December 5, 2026 11:32
7bc2d9a to
e3b1756
Compare
why: Socket creation can precede a working tmux client. One failed identity probe ended the wait while the owned daemon was still live. what: Retry the client inside the existing deadline. Exercise a failed first probe after the socket notification with a real owned daemon.
why: Product builds its recording tmux before starting a worker. The hosted image supplies SDK 8.0.428 and the project pins 8.0.425. what: Have each trial runner install the SDK named in global.json.
4 tasks done
why: The trial and stress workflows still called a tmux builder that the setup-tmux migration removed. what: Install the pinned commit through the shared macOS action. Pass its reported binary and source to the consumers, and use the same installer for the Linux stress control.
why: macOS gives a new directory its parent group. The runner can lose the setgid bit when that group is outside its memberships. what: Assign the effective group to the two fixture parents before creating children. Check that the TMPDIR fixture retains setgid.
tony
force-pushed
the
flaky-investigations-000
branch
from
December 5, 2026 14:51
6e52f07 to
5fbc6da
Compare
This branch had an error being deployed
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.
Keep the hosted macOS trial advisory and add an on-demand stress run. This replaces #4, which closed when
initial-prmerged into master and its branch was deleted; the commits are rebased onto master.The socket readiness check retries inside its existing one-second deadline.
Root causes
/bin/shreport the kernel's physical path; the tests compared it with/tmpand/etc, which are symlinks on macOSbashfor/bin/shtmux -Dsignals readiness only by creating its socket, and an FSEvents watch (.NET'sFileSystemWatcheron macOS) never reports a Unix socket02700yielded0700.global.json/tmpTMPDIRset to a deep directory reproduces the error on Linux before and passes afterHTTPServer.server_bindcallssocket.getfqdnbefore the server prints its address (server.py#L138-L143); on the hosted macOS runner the reverse lookup of 127.0.0.1 takes 35 s in setup-python 3.13.15, Homebrew 3.14.7 and python.org 3.14.7, and 0.05 s in Apple's 3.9.6 (run 38066913812)socketserver.TCPServerand print the same lineMACOS_CI.md records the rules for contributors.
Before and after
Historical macOS stress runs, every real-tmux suite on macos-latest arm64, tmux 3.7c, PowerShell 7.4.20:
Remaining
WorkspaceCorpus exceeds its 30 s per-script deadline on two macos-15 arm64 cells when it shares the runner with a second worker (run 38082614210); alone it takes about 16 s. Each pane command in it launches about 18 tmux client processes, about 31 ms each on macOS against 2 ms on Linux, so one
Invoke-TmuxPaneCommandtakes 453 to 705 ms there (run 38083713742). The trial keeps these timings visible per cell. The broader macOS reliability work is tracked separately. Tracking issueAt
6e52f07, Sandbox passed in seven of the eight advisory cells. Intel on PowerShell 7.4.20 with tmux 3.3a reached its 30 s Sandbox deadline. The setgid assertion recorded zero failures. Across the full macOS matrix, Product passed in zero of eight cells and Documentation in six of eight. The two failing Documentation cells reached their Help worker deadlines. Trial resultsOn tmux 3.3a the no-pattern pane wait returned
TimedOuton Intel. On Apple Silicon the wait finished before the test sent the suffix of a split line. Both PowerShell versions passed the same PaneTextWait suite on Linux. The existing fixture uses a timed pause after the first capture. The hosted results do not identify which observation consumed the one-second wait budget. Intel job · Apple Silicon job · Fixture historyCI notes
macos-trial.ymlcovers Intel and Apple Silicon, PowerShell 7.4.20 and 7.6.10, and tmux 3.3a and 3.7c. Its summary records each Product and Documentation outcome. These suites are advisory.macos-stress.ymlruns on manual dispatch. Itssuitesinput selects the suites to repeat.