Skip to content

Fix replica drift convergence test race - #10

Merged
remdui merged 1 commit into
mainfrom
fix/replica-drift-test-race
Sep 2, 2026
Merged

Fix replica drift convergence test race#10
remdui merged 1 commit into
mainfrom
fix/replica-drift-test-race

Conversation

@remdui

@remdui remdui commented Sep 2, 2026

Copy link
Copy Markdown
Member

Cause

The merged main CI exposed a timing race in ReplicaControllerTest.followerConvergesThenBacksUpAndRepairsFilesystemDrift.

The test waited only until config.yml had been materialized as generation 2, then immediately asserted that the host had reconciled. Production applyRemote() intentionally performs these steps in order:

  1. materialize authoritative files;
  2. reconcile the host graph;
  3. update the applied generation/LKG/status.

A runner can therefore observe the file between steps 1 and 2, making the test flaky even though the controller behavior is correct.

Fix

Wait for the completed convergence contract instead of the intermediate filesystem write:

  • config.yml == "two"
  • host reconciliation has occurred
  • ReplicaStatus.appliedGeneration == 2

Then assert the controller is READY before introducing manual drift.

No production code changes.

@remdui
remdui merged commit 5b83be3 into main Sep 2, 2026
5 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