Skip to content

test: TestLoginRememberedTimer sometimes fails: a value the store gave out is not cleared #210

Closed

Description

@groupsky

What happened

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).

Activity

  1. groupsky commented on Nov 18, 2026

    @groupsky
    ContributorAuthor

    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).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions