Flaky: api.rs run_wait_capture_history_search_export gets an empty last-command capture #60
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Found during #55 (while running api.rs 20 times for #35, under load from other worktrees): 1 of 20 runs failed at api.rs:172,
capture?scope=last-commandcame back empty afterwait?until=exitreturned exit 4 forecho first-$((20+1)); echo second; exit 4.Likely: the pane's wait thread reports the exit (and the command end is marked at the ring's end) before the reader thread has read the program's last output off the PTY, so the command's range is empty. A fix would be to drain the master (read until EIO) before handling the exit, or mark the end once the reader hits EOF.
Fixed (merge of branch flakes). A real race: a pane's exit could be applied before the reader had taken the program's last output. The exit now waits (up to 1 s) for the reader to reach the terminal's hangup. Also fixed broken-pipe and closed-pane timing in the same test. Under load, 62 of 200 runs failed before and 0 of 400 after.