Repository navigation
test(terminal): a busy runner gets more attempts to send a key byte by byte - #153
Merged
Merged
Conversation
…y byte The fragmented-key check throws away an attempt whose writes took longer than 0.2 s (the script was held up, which proves nothing about the menu) and tries again, five times at most. A busy macOS runner stretched every sleep for longer than that: five attempts in a row took 0.21-0.33 s, and macos-terminal failed twice on 2026-11-18 (#151, #152) with nothing wrong in the menu. It now tries up to 30 times within 20 s, says how many attempts a key took when it needed more than one, and the failure names the count. The budget, the gap between bytes and what is checked are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Only right after the lock button with a read following; what was tried and didn't reproduce it; the cause is inside axauditd. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
What and why
macos-terminalfailed twice on 2026-11-18 with nothing wrong in the menu (#151's first run, #152's first run); a re-run passed both times:tests/terminal.pysends a key one byte at a time, 40 ms apart (80 ms for three bytes), and throws away an attempt whose writes took longer than 0.2 s: the script was held up, which says nothing about the menu's 250 msSEQUENCE_WAIT. It allowed five attempts. On a busy runner every sleep was stretched for a while, so all five were thrown away.The check now tries up to 30 times within 20 s, prints how many attempts a key took when it needed more than one (to see in CI logs how busy the runner was), and a failure names the count. The 0.2 s budget, the 40 ms gap and what is checked don't change.
A second commit adds what the axauditd stall of regression case #155 was traced to (only right after the lock button, the cause is inside axauditd; what was tried).
Tests
1. Unit tests
python3 tests/terminal.py --binary target/debug/iphone-control --test-dir target/debug/depspasses (Debian 12, in Docker)note: sending b'\x1b[B' took 7 attempts (the slow ones: [0.24, 0.24, 0.24, 0.4, 0.24, 0.24])could not send b'\x1b[B' within 0.0s in 30 attempts: took [0.080…]tests/check_regression_cases.py: 155 cases, 0 missing2. Real-device regression
3. Regression cases
4. Real-device proof
Checklist
🤖 Generated with Claude Code