Skip to content

Commit ece21fb

Browse files
committed
fix(tests): use wait_until_pane_ready in waiter test
why: test_wait_for_any_content_exact_match was flaky due to race condition - pane content captured before terminal finished redrawing after clear command. what: - Add wait_until_pane_ready() after send_keys("clear") to ensure shell prompt is ready before capturing content - Uses idiomatic waiter pattern instead of arbitrary time.sleep()
1 parent 26259b1 commit ece21fb

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

tests/_internal/test_waiter.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1413,8 +1413,9 @@ def test_wait_for_any_content_exact_match(wait_pane: Pane) -> None:
14131413
This specifically targets lines 823-827 in the wait_for_any_content function,
14141414
ensuring exact matching works correctly.
14151415
"""
1416-
# Clear the pane and add specific content
1416+
# Clear the pane and wait for shell to be ready (idiomatic pattern)
14171417
wait_pane.send_keys("clear", enter=True)
1418+
wait_until_pane_ready(wait_pane, timeout=2.0)
14181419

14191420
# Capture the current content to match it exactly later
14201421
content = wait_pane.capture_pane()

0 commit comments

Comments
 (0)