Skip to content

test(server): ServerSecretStore race test is flaky #249

Closed

Description

@lukemaj

What: apps/server/src/auth/ServerSecretStore.test.ts › "returns the persisted secret when concurrent creators race" failed once, then passed three runs in a row on the same tree.
Why: unknown; it looks timing-dependent (a race test), and it is outside the code #247 changes.
So what: an agent reproduces it in a repeat loop and makes the test deterministic; no user action needed.

Outcome

The race test passes reliably.

Problem Statement

Elon record

  • Requirements and who asked: the user's standing rule to file problems found during other work; a flaky test erodes trust in the server suite.
  • Deleted: nothing yet; the cause is not known.
  • Bottleneck: reproducing the failure on demand.
  • Checked myself: one failure and three clean reruns of the same files on the same tree.

Acceptance criteria

  • The test passes in a repeat loop (for example 50 runs).

Non-goals

  • Changing the secret store's behaviour unless the flake reveals a real race.

Blockers

  • None.

Required proof

  • A repeat-loop run with no failures.

Activity

  1. lukemaj commented on Oct 14, 2026

    @lukemaj
    ContributorAuthor

    Fixed by #261 (merged as 54fb0fc). The flake was a real race: a losing creator could read the winner's secret file before its bytes were written. create now writes a temp file and hard-links it into place; a deterministic regression test covers it, and the file passed 50/50 loop runs.

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