Commit 23592e0
committed
Test(fix[control-mode]): Bound the wait off the descriptor
why: The test asked select whether the descriptor had a line and then
read with readline, which serves from the buffer above it. ControlMode
runs its subprocess with text=True, and tmux writes a whole
%begin/%end block in one burst, so the first readline routinely drains
every remaining line off the descriptor -- select then reports nothing
ready while the answer is already in hand. Passing at all depended on
unrelated %output from the pane's shell re-arming select. Closes #731.
what:
- Read lines on a thread and poll a queue with a monotonic deadline, so
the wait is bounded without consulting the descriptor
- Explain in the helper why the descriptor cannot answer the question
- Leave ControlMode alone: text=True and encoding="utf-8" are the
behaviour this test guards1 parent be7c8c1 commit 23592e0
2 files changed
Lines changed: 67 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
62 | 69 | | |
63 | 70 | | |
64 | 71 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
| 9 | + | |
| 10 | + | |
9 | 11 | | |
10 | 12 | | |
11 | 13 | | |
| |||
14 | 16 | | |
15 | 17 | | |
16 | 18 | | |
| 19 | + | |
| 20 | + | |
17 | 21 | | |
18 | 22 | | |
19 | 23 | | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
20 | 78 | | |
21 | 79 | | |
22 | 80 | | |
| |||
86 | 144 | | |
87 | 145 | | |
88 | 146 | | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
| 147 | + | |
94 | 148 | | |
95 | 149 | | |
96 | 150 | | |
| |||
0 commit comments