Skip to content

test(control-plane): de-flake auth-link integration tests#1829

Merged
muscariello merged 3 commits into
mainfrom
deflake/control-plane-integration-tests
Jul 12, 2026
Merged

test(control-plane): de-flake auth-link integration tests#1829
muscariello merged 3 commits into
mainfrom
deflake/control-plane-integration-tests

Conversation

@muscariello

@muscariello muscariello commented Jul 12, 2026

Copy link
Copy Markdown
Member

De-flake for the flaky control-plane integration tests (rotating test_link_* failures under CI load, red on main too). Root cause: ~30 node-spinning tests run under plain cargo test and starve each other, stalling reconciliation past the timeouts.

  • auth_link(): select the connector-sourced link (skips transient reverse links that trip the source assert).
  • Timeouts: 30→60s / 15→30s headroom under llvm-cov.
  • Cap concurrency: semaphore (2–4 slots) held per test via TestControlPlane.

Contention only reproduces under CI, so needs a couple of coverage/unittest-matrix runs to confirm.

Base automatically changed from fix/config-retryif-spawn to main July 12, 2026 20:20
The auth-link integration tests failed intermittently in CI (a different
`test_link_*` test each run, always at the same two assertion sites, and on
`main` too) under slow, heavily-parallel jobs such as the llvm-cov coverage run.

Two independent causes:

1. Wrong-link race. `auth_link()` matched the first link sourced from *either*
   the connector or the protected group, but `wait_auth_link()` then asserts the
   source is the connector. During reconciliation a transient protected-sourced
   link can reach the target status first, tripping the assertion. Select the
   connector-sourced link directly so transient links are skipped and the loop
   keeps polling for the one every caller actually expects.

2. Timeouts too tight under instrumentation. Reconciliation occasionally needs
   longer than 30s/15s when the runner is saturated (llvm-cov, parallel matrix),
   causing `wait_*` timeout panics. Double DEFAULT_TIMEOUT (30->60s) and
   SHORT_TIMEOUT (15->30s); the happy path returns immediately, so passing tests
   are unaffected.

No production code changes; test-only.

Signed-off-by: Luca Muscariello <muscariello@ieee.org>
@muscariello muscariello force-pushed the deflake/control-plane-integration-tests branch from fed688c to 211974d Compare July 12, 2026 20:22
…rvation

Gate each control-plane integration test through a shared semaphore (2-4
slots, scaled to available parallelism), with the permit held for the test's
lifetime via TestControlPlane. Prevents the ~30 node-spinning tests from
starving each other of CPU under llvm-cov / matrix CI, which stalled
reconciliation past the wait timeouts and caused the rotating flake.

Signed-off-by: Luca Muscariello <muscariello@ieee.org>
… flake

A persistently-failing link is only marked LINK_FAILED once reconciler
requeues exhaust, with exponential backoff (base x 2^n). At max_requeues=10
that's ~51s of cumulative backoff, which exceeds the wait_auth_link timeout
under slow llvm-cov runs and caused failure-expecting tests (wrong creds,
missing workload API) to flake. Lower to 7 (~6s to fail). Recovery tests are
unaffected — they recover via a fresh node registration, not the requeue chain
(verified locally).

Signed-off-by: Luca Muscariello <muscariello@ieee.org>
@codecov

codecov Bot commented Jul 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@muscariello muscariello marked this pull request as ready for review July 12, 2026 21:30
@muscariello muscariello requested a review from a team as a code owner July 12, 2026 21:30
@muscariello muscariello merged commit 580208b into main Jul 12, 2026
30 of 31 checks passed
@muscariello muscariello deleted the deflake/control-plane-integration-tests branch July 12, 2026 21:31
@build-agntcy build-agntcy mentioned this pull request Jul 12, 2026
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