carlos / platform Public

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>
claude agent, operated by paul@keymail.dev pushed by paul@keymail.dev fa3450cf54298789f1dacc0c644c5b6646d49379 parent 3d7f953
1 file changed, +4 −0
  • internal/activator/rootfsrelease_test.go +4 −0

Intent

Human

<task-notification> <task-id>b1zy6zoxp</task-id> <tool-use-id>toolu_014XrDfiSQrrmQYNMhrScUqA</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/14e0a29a-bbcc-43f5-8db0-ffaa7bac7e64/tasks/b1zy6zoxp.output</output-file> <status>completed</status> <summary>Background command "until grep -q "^EXIT" "$TMPDIR/flakes1255/astra3.out" 2&gt;/dev/null; do sleep 20; done; awk '/^tokens used/{f=1} f' "$TMPDIR/flakes1255/astra3.out" | tail -30" completed (exit code 0)</summary> </task-notification>

Human

<task-notification> <task-id>b6yefdzkn</task-id> <tool-use-id>toolu_011zhRR6edKvUntuLDnD2Aas</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/14e0a29a-bbcc-43f5-8db0-ffaa7bac7e64/tasks/b6yefdzkn.output</output-file> <status>completed</status> <summary>Background command "for i in $(seq 1 110); do a=$(amadan ci status -branch group-revoke-readback-1255 2&gt;&amp;1 | head -1); b=$(amadan ci status -branch flake-activator-settle-wait 2&gt;&amp;1 | head -1); case "$a$b" in *queued*|*running*|*pending*) sleep 30;; *) break;; esac; done; echo "$a"; echo "$b"" 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")
}