notify: make the shutdown tests fail with the right message (closes #116) #174

Merged
clawbot merged 1 commits from issue-116-notify-shutdown-tests into next 2026-10-01 20:42:22 +02:00
Collaborator

Implements #116 in
internal/notify/shutdown_test.go. Production code is unchanged.

  • drainSlack becomes three constants, one per meaning: longDrainDeadline
    (deadline for a drain that should finish well before it), timeoutDrainBound
    (watchdog on a drain given drainDeadline) and reachEndpointTimeout (wait
    for a delivery to reach the test server). Each says what it bounds and why
    2s. No value changed.
  • The idle-drain failure names idleDrainBound, the bound it checks, with the
    deadline as context.
  • TestDrainWithCancelledContextDoesNotWarn also requires the drain to return
    within idleDrainBound (a watchdog, as in
    TestDrainBoundedByContextDeadline) and to log its debug line.

Mutation checks in shutdown.go, each reverted:

  • Idle drain waits for its deadline: the idle test fails naming the 500ms bound.
  • Drain ignores its deadline: the watchdog fails naming 2s and the 50ms
    deadline.
  • Delivery never runs: both endpoint waits fail.
  • Guard for nothing outstanding removed: the cancelled-context test fails on the
    missing debug line and on the warning.
  • That guard's branch never returns: the cancelled-context test fails naming
    500ms.
  • Drain does nothing: the cancelled-context test fails on the missing debug
    line, which the absence-only check let through.

Judgement call: newLoggingService now records debug level for all three tests
that use it; the other two only gain lines in their failure output.

Model: opus-5-5

Implements https://git.eeqj.de/sneak/dnswatcher/issues/116 in `internal/notify/shutdown_test.go`. Production code is unchanged. - `drainSlack` becomes three constants, one per meaning: `longDrainDeadline` (deadline for a drain that should finish well before it), `timeoutDrainBound` (watchdog on a drain given `drainDeadline`) and `reachEndpointTimeout` (wait for a delivery to reach the test server). Each says what it bounds and why 2s. No value changed. - The idle-drain failure names `idleDrainBound`, the bound it checks, with the deadline as context. - `TestDrainWithCancelledContextDoesNotWarn` also requires the drain to return within `idleDrainBound` (a watchdog, as in `TestDrainBoundedByContextDeadline`) and to log its debug line. Mutation checks in `shutdown.go`, each reverted: - Idle drain waits for its deadline: the idle test fails naming the 500ms bound. - Drain ignores its deadline: the watchdog fails naming 2s and the 50ms deadline. - Delivery never runs: both endpoint waits fail. - Guard for nothing outstanding removed: the cancelled-context test fails on the missing debug line and on the warning. - That guard's branch never returns: the cancelled-context test fails naming 500ms. - Drain does nothing: the cancelled-context test fails on the missing debug line, which the absence-only check let through. Judgement call: `newLoggingService` now records debug level for all three tests that use it; the other two only gain lines in their failure output. Model: opus-5-5
clawbot self-assigned this 2026-10-01 20:11:42 +02:00
clawbot added 1 commit 2026-10-01 20:11:42 +02:00
drainSlack stood for three things: the deadline given to a drain that
should finish early, the watchdog on a drain that should time out, and
the wait for a delivery to reach the test server. It is now three
constants, each commented with what it bounds and why it is 2s; no
value changed. The idle-drain failure printed that deadline instead of
idleDrainBound, the bound it checks. The cancelled-context test now
also requires the drain to return within idleDrainBound and to log its
debug line, so a drain that logs nothing no longer passes;
newLoggingService records debug level for this.

Model: opus-5-5
clawbot added the needs-review label 2026-10-01 20:11:46 +02:00
Author
Collaborator

Review passed on de8953b.

Model: opus-5-5

Review passed on de8953b. Model: opus-5-5
clawbot merged commit 5493e28480 into next 2026-10-01 20:42:22 +02:00
clawbot deleted branch issue-116-notify-shutdown-tests 2026-10-01 20:42:22 +02:00
clawbot removed the needs-review label 2026-10-01 20:42:25 +02:00
Sign in to join this conversation.