Skip to content

Commit c24c73a

Browse files
committed
fix: retry PTY drain on empty select() to prevent data loss on macOS
The PTY drain logic in read_pty_output's finally block broke out of the drain loop after a single empty select() poll (100ms). On macOS CI runners under load (make test -j4 with concurrent package installs), PTY kernel buffer delivery can be delayed beyond 100ms after subprocess exit, causing the drain to miss the output entirely. Replace the immediate break with a consecutive empty poll counter that requires 3 empty select() calls (~300ms) before concluding the drain is complete. This extends the tolerance window while still respecting the existing DRAIN_TIMEOUT_SECONDS (2s) and MAX_DRAIN_BYTES limits. Isolated reproduction confirms: - Original: 0/20 pass rate when data arrives >100ms after drain starts - Fixed: 20/20 pass rate for delays up to 250ms+ Fixes #821
1 parent a3bcb14 commit c24c73a

37 files changed

Lines changed: 9509 additions & 2 deletions

.agentready/assessment-20260525-094133.json

Lines changed: 1332 additions & 0 deletions
Large diffs are not rendered by default.

.agentready/assessment-latest.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
assessment-20260525-094133.json

0 commit comments

Comments
 (0)