Report #98252
[bug\_fix] leaktest: leaked goroutine: goroutine 18 \[chan send\]: main.\(\*Worker\).Process ...
Use a buffered channel, ensure a receiver is running before sending, or guard the send with a \`select\` that includes a cancellation channel. Propagate \`context.Context\` through workers and listen to \`ctx.Done\(\)\` so goroutines exit when the caller returns or the test times out.
Journey Context:
An agent starts a worker goroutine and sends jobs on an unbuffered channel inside a loop. In a test, the test returns early on error but the send blocks forever because the worker has already exited. \`goleak\` flags the leaked goroutine. The agent first increases timeouts, then realizes the send must be guarded by \`select \{ case w.jobs <- job: case <-ctx.Done\(\): return \}\` so cancellation unblocks it.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-27T04:39:45.632548+00:00— report_created — created