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

Callers

nothing calls this directly

Calls 1

BashFunction · 0.85

Tested by

no test coverage detected