Replace fixed settle-sleeps in tmux tests with polling#283
Merged
Conversation
79049bc to
f2baf94
Compare
9eb8b2b to
4bdb0e4
Compare
f2baf94 to
eb748fe
Compare
4bdb0e4 to
eb1854c
Compare
eb748fe to
2e4fb8a
Compare
eb1854c to
7daadef
Compare
2e4fb8a to
aa9c340
Compare
7e0d7c7 to
616d227
Compare
aa9c340 to
022ca0b
Compare
616d227 to
9c864b6
Compare
022ca0b to
a7dab8a
Compare
9c864b6 to
b6dc7b8
Compare
89e338c to
695663d
Compare
0ce5a16 to
ee68ce9
Compare
428c742 to
5bca605
Compare
ee68ce9 to
26457e4
Compare
The real-tmux integration tests waited fixed windows (50/100/200ms) for a session to settle before capturing and asserting. Those flake on a loaded or slow CI runner, and worse, a fixed window gives a real send/ capture-latency regression room to hide: as long as the bug fits inside the sleep, the test stays green. Add an `eventually(timeout, cond)` helper and convert the clear "settle then capture/assert" sites — the SendKeys round-trip echo check and four capture/pane-id resolution tests — to poll for the observable condition instead. Polling for the actual state is strictly better than a fixed wait: faster when the host is fast, and it does not mask a latency regression behind a generous sleep. The remaining structural settle-sleeps (e.g. after split-window before an error-shape assertion) are left as-is; this converts the content/readiness waits where polling is an obviously-correct transformation. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
26457e4 to
b3e3cc1
Compare
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.
Close-the-loop stack — PR 12/12 (final)
Problem
The real-tmux integration tests waited fixed windows (50/100/200ms) for a session to settle before capturing and asserting. Those flake on a loaded/slow CI runner — and worse, a fixed window gives a real send/capture-latency regression room to hide: as long as the bug fits inside the sleep, the test stays green.
Change
Add an
eventually(timeout, cond)helper and convert the clear "settle then capture/assert" sites — theSendKeysround-trip echo check and four capture/pane-id resolution tests — to poll for the observable condition. Polling for the actual state is strictly better than a fixed wait: faster on a fast host, and it can't mask a latency regression behind a generous sleep.The remaining structural settle-sleeps (e.g. after
split-windowbefore an error-shape assertion) are left as-is; this converts the content/readiness waits where polling is an obviously-correct transformation.Verification note
These tests skip on local macOS tmux 3.6a (empty tmux servers self-exit, defeating the shared
start-serverprobe — a deeper issue than this PR), so they're verified by thetmux-e2eCI job (where the probe works), now also running on both 3.2a and 3.6a via PR 5. The conversions compile, vet, and lint clean locally; they are mechanically poll-until-condition, which only improves on a fixed sleep.🤖 Generated with Claude Code