fix(e2e): harden input-ingestion wait against bursty rendering · Entire
fix(e2e): harden input-ingestion wait against bursty rendering
3956809→main·
pfleidi·2w ago·2 files·+16 added/-5 removed
Require two consecutive stable polls in waitForInputIngested so a single quiet interval mid-paste can't fake stability, and document why it compares raw captures instead of stableContent. Re-print the vogon prompt when ignoring an empty line so manual REPL sessions stay readable.
Addresses PR #1599 review feedback.
Sessions
944b219ab908View transcript
[?
Debug E2E Test Timing IssuesClaude Code·Opus 4.8[1m]·4 steps](/content/gh/entireio/cli/session/58280a70-c670-4b2d-a1c8-80439ef7460d#timeline-944b219ab908/index.html)
Changes
2
e2e
agents
Mtmux.go+15/-5
vogon
Mmain.go+1
97 unmodified lines
// waitForInputIngested waits until the pane content has changed from preSend
// (the echoed input is visible) and stopped changing between consecutive
// polls (the TUI's input handler has caught up), then returns the settled
// content. Gives up after 15s and returns the last capture.
// (the echoed input is visible) and held still for two consecutive polls
// (the TUI's input handler has caught up — droid renders long pastes in
// bursts, so a single quiet interval can fake stability), then returns the
// settled content. Gives up after 15s and returns the last capture.
//
// Compares raw captures: the input box lives in the bottom lines that
// stableContent strips, so stable comparison would be blind to the echo.
func (s *TmuxSession) waitForInputIngested(preSend string) string {
deadline := time.Now().Add(15 * time.Second)
last := s.Capture()
stablePolls := 0
for time.Now().Before(deadline) {
time.Sleep(300 * time.Millisecond)
current := s.Capture()
if current == last && current != preSend {
if current != last || current == preSend {
stablePolls = 0
last = current
continue
}
stablePolls++
if stablePolls >= 2 {
return current
}
last = current
}
}
return last
}
Me2e/agents/tmux.go+15/-5
70 unmodified lines
// doesn't visibly react in time, and treating that as termination
// would end the session mid-test.
if line == "" {
fmt.Fprint(os.Stdout, "> ")
continue
}
// Give tmux's Send() time to observe a distinct pre-output pane
Me2e/vogon/main.go+1