jesseduffield.lazygit/pkg
Stefan Haller 46c1fa7db2 Don't let a leaked subprocess wedge the headless test runner
When lazygit exits but leaves behind a subprocess that inherited its
stderr pipe and has detached from the pty, cmd.Wait() blocks in
awaitGoroutines waiting for that pipe to reach EOF -- which never
happens while the straggler is alive. With no WaitDelay set, that wait
is unbounded, so a single leaked process hangs the whole test binary
until the 10-minute global timeout fires and panics. Worse, the timeout
discards whatever lazygit wrote to stderr before exiting (a panic, a
-race report), which is exactly the output needed to diagnose the
failure.

This surfaces under -race, where lazygit runs slow enough to widen the
window for a spawned command to still be alive when lazygit quits, and
it's a blocker for enabling the race detector on CI.

Bound the wait with cmd.WaitDelay so Wait force-closes the pipe and
returns ErrWaitDelay instead of hanging, surface the captured stderr as
the error (falling back to the wait error when nothing was printed), and
kill the child's process group on failure so a straggler can't linger
into a later test or pile up across a run.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-20 14:26:25 +02:00
..
app Allow overriding the platform used for default keybindings 2026-07-03 19:08:22 +02:00
cheatsheet Render every key for a binding in the cheatsheet 2026-05-25 15:18:18 +02:00
commands Suppress command logs for git calls related to the ctrl+f command 2026-07-19 19:22:48 +02:00
common Move NewDummyCommon to pkg/common 2025-05-06 09:43:26 +02:00
config Add gui.shrinkSidePanelsToContent option 2026-07-03 19:25:01 +02:00
constants Make the links in the status panel point to the current version rather than master 2024-03-22 08:13:59 +01:00
env Support bare worktrees where worktree does not have its own .git file 2023-08-07 22:40:53 +10:00
fakes Modernize all codes 2025-11-15 10:46:23 +01:00
gocui Schedule a redraw when resuming from suspension 2026-07-20 14:23:09 +02:00
gui Suppress command logs for git calls related to the ctrl+f command 2026-07-19 19:22:48 +02:00
i18n Show a waiting status while creating a branch 2026-07-17 12:32:32 +02:00
integration Don't let a leaked subprocess wedge the headless test runner 2026-07-20 14:26:25 +02:00
jsonschema Fold legacy quit-alt1 into the multi-key quit binding 2026-05-25 15:32:47 +02:00
logs Fix Windows linter errors 2026-06-16 16:21:13 +02:00
snake Enable intrange linter, and fix warnings 2025-06-30 18:30:11 +02:00
tasks Handle a command task's end-of-input on the UI thread 2026-07-17 12:35:54 +02:00
theme Copy gocui files into lazygit repo under pkg/gocui 2026-04-30 14:29:08 +02:00
updates Change direct access to Common.UserConfig to a getter 2024-08-18 10:24:52 +02:00
utils Expand a leading ~ in worktree paths to the home directory 2026-07-03 18:53:05 +02:00