MCPcopy Create free account
hub / github.com/codehamr/codehamr / TestBashBackgroundedChildDoesNotBlock

Function TestBashBackgroundedChildDoesNotBlock

internal/tools/bash_test.go:203–212  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

201 t.Fatalf("parent-cancel must not be reported as timeout: %q", out)
202 }
203}
204
205func TestBashBackgroundedChildDoesNotBlock(t *testing.T) {
206 // A naked `cmd &` leaves the child holding stdout/stderr pipes. We must not
207 // block on them after /bin/sh exits, which caused multi-minute stalls
208 // before WaitDelay was set.
209 start := time.Now()
210 Bash(context.Background(), "sleep 3 &", 5*time.Second)
211 if elapsed := time.Since(start); elapsed > 500*time.Millisecond {
212 t.Fatalf("bash blocked for %s on backgrounded child's pipes; want <500ms", elapsed)
213 }
214}
215

Callers

nothing calls this directly

Calls 1

BashFunction · 0.85

Tested by

no test coverage detected