activator test: wait for the sweep's retry to end, not begin
TestUnprovenReleaseOnAnAwakeIncumbentIsRetried flaked on CI ("timed out
waiting for the reaper's proof"). The test waited for the retry's
StopAndSettle call to be counted, which happens when the attempt
begins. The hold clears settling and stamps lastTry only after it
returns. If the test's next sweepOnce ran before then, retrySettle
skipped it (an attempt in flight, or lastTry stamped after the fake
clock's advance), and no later sweep came.
The test now also waits for settlingDone. Test-only; the product's
sweep runs every tick, so a skipped pass is retried.
Reproduced deterministically by making the stuck settle take 200 ms
(fails 3/3 at the reaper's proof); passes with the fix, and every
Release/Shutdown test passes with that delay. Stress: 200/200 under
-race -cpu 1,4 after.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 file changed,
+4
−0
internal/activator/rootfsrelease_test.go+4 −0
Intent
Human
<task-notification> <task-id>b97q1wzin</task-id> <tool-use-id>toolu_01RLV4ckKyb2vVM6BqHTPdDN</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/14e0a29a-bbcc-43f5-8db0-ffaa7bac7e64/tasks/b97q1wzin.output</output-file> <status>completed</status> <summary>Background command "time nice -n 19 go test ./internal/activator/ -run '^TestUnprovenReleaseOnAnAwakeIncumbentIsRetried$' -count=200 -race -cpu 1,4 2>&1 | tail -30" completed (exit code 0)</summary> </task-notification>
diff --git a/internal/activator/rootfsrelease_test.go b/internal/activator/rootfsrelease_test.go| index 9b05e5f04..6a9daec32 100644 |
| --- a/internal/activator/rootfsrelease_test.go |
| +++ b/internal/activator/rootfsrelease_test.go |
| @@ -1951,6 +1951,10 @@ func TestUnprovenReleaseOnAnAwakeIncumbentIsRetried(t *testing.T) { |
| r.clk.advance(actStopTimeout) |
| r.a.sweepOnce() |
| waitFor(t, "the sweep's retry", func() bool { return len(r.rel.unit.stopTimes()) == n+1 }) |
| + // The count rises when StopAndSettle begins; the attempt ends (no |
| + // settle in flight, lastTry stamped) only after it returns. A sweep |
| + // before then is skipped, so the next one waits for the end. |
| + waitFor(t, "the sweep's retry to end", op.hold.settlingDone) |
| if !pinned(t, r.a, r.rt.Host, "v2") { |
| t.Fatal("the pin went with the unit unproven") |
| } |