In internal/notify/shutdown_test.go, TestDrainWaitsForInFlightDelivery and TestNewRegistersDrainingStopHook start a test webhook server whose handler blocks until the test closes release, and close it from a timer. The deferred timer.Stop() runs before the deferred srv.Close(), so if the drain returns before the in-flight delivery finishes (the defect these tests exist to catch), the timer is stopped, release is never closed, srv.Close() waits for the blocked handler, and the whole package hangs until the 90-second test timeout instead of failing.
Separately, the watchdog comment in TestDrainBoundedByContextDeadline names a 30-second timeout; script/test sets 90 seconds.
Definition of done
In both tests, the handler is released however the test ends, before the server is closed. A drain that returns early makes the test fail within a few seconds instead of hanging; shown by breaking the drain by hand, then reverting.
The watchdog comment names the real timeout, or no number.
No timing bound is loosened. Test-only change. DNS is never mocked.
Model: opus-5-5
Found while working on https://git.eeqj.de/sneak/dnswatcher/issues/116.
In `internal/notify/shutdown_test.go`, `TestDrainWaitsForInFlightDelivery` and `TestNewRegistersDrainingStopHook` start a test webhook server whose handler blocks until the test closes `release`, and close it from a timer. The deferred `timer.Stop()` runs before the deferred `srv.Close()`, so if the drain returns before the in-flight delivery finishes (the defect these tests exist to catch), the timer is stopped, `release` is never closed, `srv.Close()` waits for the blocked handler, and the whole package hangs until the 90-second test timeout instead of failing.
Separately, the watchdog comment in `TestDrainBoundedByContextDeadline` names a 30-second timeout; `script/test` sets 90 seconds.
## Definition of done
- In both tests, the handler is released however the test ends, before the server is closed. A drain that returns early makes the test fail within a few seconds instead of hanging; shown by breaking the drain by hand, then reverting.
- The watchdog comment names the real timeout, or no number.
- No timing bound is loosened. Test-only change. DNS is never mocked.
Model: opus-5-5
clawbot
added this to the 1.0 milestone 2026-10-01 20:26:07 +02:00
Implemented in #179: both tests now release the held delivery however they end, before the test server is closed, and the watchdog comment names no timeout number.
Model: opus-5-5
Implemented in https://git.eeqj.de/sneak/dnswatcher/pulls/179: both tests now release the held delivery however they end, before the test server is closed, and the watchdog comment names no timeout number.
Model: opus-5-5
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Found while working on #116.
In
internal/notify/shutdown_test.go,TestDrainWaitsForInFlightDeliveryandTestNewRegistersDrainingStopHookstart a test webhook server whose handler blocks until the test closesrelease, and close it from a timer. The deferredtimer.Stop()runs before the deferredsrv.Close(), so if the drain returns before the in-flight delivery finishes (the defect these tests exist to catch), the timer is stopped,releaseis never closed,srv.Close()waits for the blocked handler, and the whole package hangs until the 90-second test timeout instead of failing.Separately, the watchdog comment in
TestDrainBoundedByContextDeadlinenames a 30-second timeout;script/testsets 90 seconds.Definition of done
Model: opus-5-5
clawbot referenced this issue2026-10-01 20:30:33 +02:00
Implemented in #179: both tests now release the held delivery however they end, before the test server is closed, and the watchdog comment names no timeout number.
Model: opus-5-5