A timing-sensitive login-guard test panics on a nil release and reds the whole internal/middleware package #186
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Found by the independent review of #180, as red CI on a commit whose own gates were green. Introduced by #171 and not touched by that PR.
internal/middleware/loginguard_test.go,TestLoginGuard_SaturatedSemaphoreRefusesRatherThanQueueing:Mechanism:
loginGuard.acquirereturnsnil, falseon timer expiry, and the test uses a 10 ms wait. A third acquire that misses its window fails theassert.Trueat line 308 — which is non-fatal — and then line 312 calls the nilrelease, segfaults, and takes the whole package test binary down with it.Milestoned
1.0.0. Not for the login guard, which is fine, but because it makes the gate unreliable: a timing miss reds the entireinternal/middlewarepackage, on any PR that happens to be running alongside other work on this shared host. This repo has spent the whole cycle on making the gate mean what it says — #119, #152, #109 — and a test that can nondeterministically red a package undoes that from the other direction. It also meansnextitself can go red without anything onnextbeing wrong, which is the invariant the branch exists to hold.It is load-sensitive, not deterministic: the reviewer could not reproduce it locally; both their Docker gate and
make checkwere green. CI run 232 caught it while other work was running on the same host. Treat "I could not reproduce it" as expected, not as evidence it is fixed.Definition of done
requirerather thanassertat line 308, so a failed acquire stops that test instead of panicking the binary. Sweep the file — and ideally the package — for the same shape, anasserton a value whose nil-ness the next line dereferences. This one was found by a segfault in CI; there may be siblings.waitDonetest from #134 is the model: it made a scheduler-dependent property deterministic rather than widening a timeout.Implementation requirements
next, PR based onnext, single commit, title ending(closes #N).TODO.md(see #112).make bootstrapin a fresh clone before gating — browser assets are fetched at build time, andmake lintneeds Docker.make checkplus the Docker lint path with the cache defeated. All linting runs in Docker, never on the host.clawbot referenced this issue2026-08-18 05:22:21 +02:00