You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
test: TestLoginRememberedTimer sometimes fails: a value the store gave out is not cleared #210
On 2026-11-17, the CI job test (stable) of #209 failed once in a test that #209 does not touch:
--- FAIL: TestLoginRememberedTimer/the_broker's_timer
remembered_test.go:614: value 2 that the store gave out is not cleared
remembered_test.go:614: value 3 that the store gave out is not cleared
FAIL github.com/code6x/nodkey/internal/broker
A rerun of the job passed. 20 local runs (go test -race -count=20 -run TestLoginRememberedTimer ./internal/broker/) pass. So it is a rare flake, maybe one that shows only under load: since #209, the contract tests run in the same go test -race ./... job.
The check is about clearing values from memory, so the test needs a look: either the test waits too little, or the broker sometimes clears a value late.
Done when
The cause is known: a test timing problem, or a value that the broker clears late.
Fixed, and go test -race -count=200 -run TestLoginRememberedTimer ./internal/broker/ passes, also with the CPU busy (for example with -cpu 1,2).
Fixed in #219 (squash commit 4175660); the cause is written in #205 and in #219.
The cause: a value that the broker cleared late. The request of a pre-approval cleared its own copy of the login after the answer was sent, not before. Now it clears it before the answer.
go test -race -count=200 -run TestLoginRememberedTimer ./internal/broker/, with the CPU busy: it ran as -count=200 -cpu 1,2 (so 400 runs) and passed with Go stable and with the Go of go.mod, in run 44395774524 (jobs 135125115061 and 135127611297).
Activity
groupsky commentedon Nov 18, 2026
Fixed in #219 (squash commit 4175660); the cause is written in #205 and in #219.
go test -race -count=200 -run TestLoginRememberedTimer ./internal/broker/, with the CPU busy: it ran as-count=200 -cpu 1,2(so 400 runs) and passed with Go stable and with the Go ofgo.mod, in run 44395774524 (jobs 135125115061 and 135127611297).