activator test: wait for the stop a pause-points subtest starts
TestMoveTicketsPausePoints/"while begin waits on a stop" ran its stop on a goroutine and returned without waiting for it. The stop's HA release then wrote its marker after the subtest's fixture had closed, failed, and owed it into lease's process-wide obligation store. The next test on shop.example.com (TestLargeManifestReleaseThenKeep, same CI shard, next in order) settled it in AcquireHA against its own fixture: one extra refused PUT lock.json before the wake's GET and PUT. The subtest now waits for its stop and asserts it finished with no marker owed for its lock. Pre-existing on main: under 12 CPU hogs on 16 cores the pair failed 87/300 on main f2cf2828 and 78/300 at this branch's tip; with the fix, 0/300. Test-only; no production change.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
internal/activator/handover_test.go+21 −1
CI passed — run details
Intent
<task-notification> <task-id>bmil3el6m</task-id> <tool-use-id>toolu_01TY4XegiMdjaxfsGBp4rMFm</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/ab362fc0-f177-4a7f-a92e-4a29ea210aad/tasks/bmil3el6m.output</output-file> <status>completed</status> <summary>Background command "Run Astra's 1b round 3 after its limit lifts" completed (exit code 0)</summary> </task-notification>
<task-notification> <task-id>a95c49a89c67de8f9</task-id> <tool-use-id>toolu_01SCMZbygHE1PZyQQBRnHp8B</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/ab362fc0-f177-4a7f-a92e-4a29ea210aad/tasks/a95c49a89c67de8f9.output</output-file> <status>completed</status> <summary>Agent "2b Task 0: UX pass mockups" finished</summary> <note>A task-notification fires each time this agent stops with no live background children of its own. The user can send it another message and resume it, so the same task-id may notify more than once.</note> <result>I wrote three files, all untracked: `mb-copy/copy-review/preview/index.html`, `mb-copy/copy-review/strings.json` and `mb-copy/layout-decisions.md`. The preview check finds no errors. I looked at it at 390 and 1280 px, light and dark, and deleted the screenshots and scratch. There are 46 strings: 4 `backups.test.*`, 2 `backups.cli.test.*` and 40 `fleetbackups.*`. 10 are list-only patterns, such as `{day} at {time} UTC` and the ages. I dropped `backups.test.copyupto`, because a second time on the tile doesn't read at a glance; `copy_written_at` stays in the JSON. Key layout decisions: - **Instance tile:** the value is Passed or Failed at full size, the date and time go underneath, and "We've been alerted." is a second line under that. - **Lone test tile:** when slice 1 hides the tiles (other region, too large, unavailable) and an accepted test exists, the Restore test tile shows alone. Task 4 needs a `Display` field for this. - **CLI:** the test row reads "Passed, today at 03:12 UTC", and "We've been alerted." goes on the same row. This changes Task 5's "TestNote under the rows". - **/fleet/backups:** per region, four tiles (Passed in 7 days of N, Failed, Never tested, Oldest test), a "Boxes to look at" table with chips for no recent test, status stale and unreadable record, an Instances table using slice 1's chips, and a small table with Not reached ("Not available yet"), Off-account copy ("No record") and prefix refusals. Not reached is a row, not a tile, because a tile reading "Not available yet" in every region was noise. Partial, not loaded and no records each get one banner line. Not decided: 1. Failed needs one new class, `.tile-warn`, because a warning chip in the tile made Failed look weaker than Passed. That conflicts with Task 4's "styleguide classes only" and needs a ruling; the fallback is plain "Failed" with no colour. 2. The kit only has the customer shell, so `/fleet/backups` is drawn with customer classes; the mapping to the operator shell for Task 7 is in `layout-decisions.md`. The worktree also has changes that aren't mine (`cmd/console/main.go`, `server.go`, `verifyreader*.go`), presumably from Task 2; I didn't touch them.</result> <usage><subagent_tokens>200988</subagent_tokens><tool_uses>71</tool_uses><duration_ms>743624</duration_ms></usage> </task-notification>
Attributed to this commit: 13.8 g CO₂e (1,790,218 tokens). This is an attribution, not a measurement — usage counted from this commit's own marker forward to the next one on member-backups-2a-landing, never backward from it. A turn that produced more than one commit books all of its tokens to the last one, and a concurrent session on this branch can add to the same figure. Some of it was priced using the shared default rate, because no model-specific factor row exists yet for at least one model involved. The Carbon view has the repo total, which is never derived from this attribution.
diff --git a/internal/activator/handover_test.go b/internal/activator/handover_test.go| index 86d9ef3e4..114b48ff3 100644 |
| --- a/internal/activator/handover_test.go |
| +++ b/internal/activator/handover_test.go |
| @@ -13,6 +13,7 @@ import ( |
| "github.com/carlosframework/platform/internal/boxchoice" |
| "github.com/carlosframework/platform/internal/edge" |
| "github.com/carlosframework/platform/internal/instancectl" |
| + "github.com/carlosframework/platform/internal/lease" |
| "github.com/carlosframework/platform/internal/registry" |
| ) |
| @@ -408,7 +409,11 @@ func TestMoveTicketsPausePoints(t *testing.T) { |
| } |
| } |
| d := s.a.MoveState(s.rt, askClient) |
| - go s.stopForTest(e) |
| + stopDone := make(chan struct{}) |
| + go func() { |
| + defer close(stopDone) |
| + s.stopForTest(e) |
| + }() |
| <-stopping |
| ctx, cancel := context.WithCancel(t.Context()) |
| r := edge.WithMoveTicket(httptest.NewRequestWithContext(ctx, http.MethodGet, "https://shop.example.com/", nil), d.Done) |
| @@ -434,6 +439,21 @@ func TestMoveTicketsPausePoints(t *testing.T) { |
| t.Fatal(err) |
| } |
| close(finish) |
| + // The stop runs on past finish: its release writes the lock's |
| + // marker. It must have finished, marker written, before this test |
| + // returns and its fixture closes; otherwise the marker's PUT fails, |
| + // is owed into lease's process-wide obligation store, and the next |
| + // test's acquire settles it against that test's fixture (the stray |
| + // PUT TestLargeManifestReleaseThenKeep saw on CI, #898). |
| + <-stopDone |
| + if !s.stoppedFor(e) { |
| + t.Fatal("the subtest ended with its stop still running") |
| + } |
| + for _, o := range lease.PendingObligations() { |
| + if strings.HasSuffix(o.Key, s.lockKey()) { |
| + t.Fatalf("the subtest left a release marker owed for %s", o.Key) |
| + } |
| + } |
| }) |
| } |