Skip to content

Flaky store test: operator-audit's final deleteOwnerless races the server lease heartbeat #971

Closed

Description

@jimhoyd

Observed. In CI run 36631671577 on PR #968, the workspace-verify (ubuntu-latest, 24, store, audit) job failed once. PR #968 changes no store code. The failing test was packages/store/test/operator-audit.test.ts, "a writing operator command reports its undelivered audit events and warns when no drain has kept up recently". It took 5038 ms and failed with:

Error: Collection requests: the serving process declares it differently from this project (or runs another store release); ...

Re-running the failed job passed.

Likely cause (not verified). At the end, the test runs DELETE FROM store_servers and then expects deleteOwnerless to proceed because no live server lease is left. The test's serving store still renews its lease every 5 s (SERVER_LEASE.heartbeatMs). A heartbeat that runs between the DELETE and the operator fence re-inserts the lease, so the command is refused. The 5 s test duration fits one heartbeat landing.

Suggested fix. Close the serving store (so its heartbeat stops), or expire its lease rather than deleting it, before the final deleteOwnerless.

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