Skip to content

Commit 42add28

Browse files
committed
fix(tests): add delay after send_keys in waiter test
Fixes test_wait_for_pane_content_exact_match_detailed failure on tmux 3.1b where capture_pane() was called immediately after send_keys() before the content had been flushed/rendered by tmux. The race condition manifested as: AssertionError: assert 'UNIQUE_TEST_STRING_123' in '' Adding a 0.1s delay after send_keys() allows tmux to flush the content before capture_pane() is called, fixing the timing issue on older versions.
1 parent 0145e78 commit 42add28

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

tests/_internal/test_waiter.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1847,6 +1847,9 @@ def test_wait_for_pane_content_exact_match_detailed(wait_pane: Pane) -> None:
18471847
# Send a unique string that we can test with an exact match
18481848
wait_pane.send_keys("UNIQUE_TEST_STRING_123", literal=True)
18491849

1850+
# Small delay to allow tmux to flush content (needed for older versions like 3.1b)
1851+
time.sleep(0.1)
1852+
18501853
# Get the current content to work with
18511854
content = wait_pane.capture_pane()
18521855
content_str = "\n".join(content if isinstance(content, list) else [content])

0 commit comments

Comments
 (0)