Skip to content

test: fix three flaky tests that the release check and CI found #217

Open

Description

@groupsky

Why

The first run of the Release check (#199) and the CI runs of #215 and #216 on 2026-11-18 failed on tests in code that these changes did not touch. A re-run passed each time, so the tests are flaky. The stress check of the Release check (-race -count=5 -cpu 1,2,4) will fail on them before each release.

  1. internal/broker TestLoginRememberedTimer/the_broker's_timer: remembered_test.go:614: value 2 that the store gave out is not cleared (also value 3). Seen in the stress check of https://github.com/code6x/nodkey/actions/runs/44382300500 and in CI on main at 9d63080 (https://github.com/code6x/nodkey/actions/runs/44381323315). Find out first if this is only the test or a real case where a value is not cleared (fail closed: a value must always be cleared).
  2. test/contract: contract: the trial broker did not stop cleanly: exit status 1 (Go stable, twice on ci: verify the draft release's files before publishing #216). It may be two packages that use the fixed trial directory nodkey-try at the same time.
  3. internal/ntfy TestFloodOfBadAnswers: approver_test.go:249: the approver keeps 1 values, want 0 (ci: a release-check workflow, run on demand on the release PR #215).

Also: golangci-lint on main at 9d63080 reported nolintlint ("directive ... is unused for linter gosec") for the G703 directives in internal/store/home.go and internal/store/helpers_test.go; the next run passed. The gosec G703 result seems not stable.

Done when

  • Each of the three tests passes go test -race -count=20 -cpu 1,2,4 on its package, or the cause is fixed in the code.
  • For 1: it is written down whether a value could stay in memory, and if so, the fix and a test for it.
  • The lint note on internal/store is stable (it passes or fails the same way every run).

Activity

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