Skip to content

spire: TestNodeSVIDRedeliveryCountsUnchanged is flaky under --config=race (2 pushes for one redelivered node SVID) — test race or a real wake/tick race in refreshNodeSVID #1018

Closed

Description

@bpalermo

Finding

//agent/internal/spire:spire_test under --config=race failed on PR #1016's second CI run (a CI-only change that does not touch the agent): TestNodeSVIDRedeliveryCountsUnchanged (added by #1011 for #993) failed in run 3 of 3 with "an unchanged node SVID must not push" — 2 pushes instead of 1. The other two runs passed, and #1011's own CI (including race) was green, so this is intermittent.

Job: https://github.com/bpalermo/aether/actions/runs/36349842108/job/108708095030

Why it matters beyond the flake

The assertion that failed is the production invariant, not test plumbing: a byte-identical node SVID redelivered by SPIRE must classify as unchanged and must NOT push a new snapshot generation. Two pushes for one redelivery means that under some interleaving the served-chain comparison in refreshNodeSVID (agent/internal/spire/bridge.go) does not see the first serve before the second delivery is processed — either a test-side race between the fake source's Updated() wake and the initial push completing, or a real one between the wake path and the backstop tick both entering refreshIdentity. If it is the latter, the agent bumps a no-op snapshot on every redelivery race, which is exactly the churn #993's early return exists to avoid.

Ask

  • Reproduce with bazel test --config=race --runs_per_test=200 //agent/internal/spire:spire_test and decide test-race vs code-race by reading the interleaving (the test must wait for the first push to be observed before delivering the second SVID; the code must serialise wake and tick through one refresh at a time).
  • Fix whichever it is; keep the test's assertion strength (do not weaken "must not push").
  • Until fixed, a red race on an unrelated PR with this signature is a re-run, not a finding.

Related: #993, #1011, #1016.

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

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions