Skip to content

Stop a fixed test backend id colliding with a generated one - #19

Merged
VirtualMachinist merged 1 commit into
mainfrom
v1/fix-flake
Nov 14, 2026
Merged

VirtualMachinist merged 1 commit into
mainfrom
v1/fix-flake

Conversation

@VirtualMachinist

Copy link
Copy Markdown
Member

Fixes an order-dependent test failure on main.

TestGrafanaHealthBackendSelection inserted a backend with a fixed id that the shared test helper could also generate from its counter. Under some shuffle orders the ids collided, and the command correctly reported an invalid config instead of the ambiguity the test expects.

  • The inserted id is now one the counter can never produce.
  • The helper fails loudly, naming the id, if it ever writes a duplicate.

Test file only; no product code changes.

🤖 Generated with Claude Code

The backend-selection test added a Grafana backend with the fixed id
grafana2, and the test helper renames grafana to grafana<N> from a counter
shared by the whole package. Once N reached 2 the two ids collided, the
loader saw a duplicate and the test got config_invalid instead of
ambiguous_backend. Which run hit it depended on test order, so it passed on
one OS and failed on the other.

The extra backend is now grafana-extra, an id the counter cannot produce. The
helper also checks the test config for a repeated id and fails with the cause
named, so a future fixed id of that shape says what is wrong.

Checked by repeating the selection test 40 times, by sixteen shuffle seeds
under the race detector, and by putting the old id back: the helper then names
the collision.

Signed-off-by: VirtualMachinist <252028890+VirtualMachinist@users.noreply.github.com>
@VirtualMachinist
VirtualMachinist merged commit 58136e1 into main Nov 14, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant