carlos / platform Public

console: the claim fixture object has one fixed modified time

TestClaimConsoleMutationInvariant's store/scan/object probe sometimes
answered {"state":"pending"} instead of clean. claim-fixture.txt's
version is its ETag and its Modified to the second (ScanObject.Version),
and claimOneObjectLister and scanObjectStaged each took
time.Now().Add(-time.Hour) on their own. When a second ticked between the
stage and the sweep's listing (more likely the slower the runner), the
sweep recorded its verdict on another version than the scanner held, and
Status found none for the current one. Both now use claimFixtureModified.

The probe run alone (runClaimProbe on its own claim case, 2 cores, 8 busy
loops, nice 19, -cpu 1,4,8): before 5 failures in 90, after 0 in 150.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev fe006199698715cbaccf0a0ede70af44b72cb722 parent 90c1f17
2 files changed, +11 −2
  • internal/console/claim_invariant_fixtures_test.go +1 −1
  • internal/console/claim_invariant_world_test.go +10 −1
diff --git a/internal/console/claim_invariant_fixtures_test.go b/internal/console/claim_invariant_fixtures_test.go
index d652a234b..785922768 100644
--- a/internal/console/claim_invariant_fixtures_test.go
+++ b/internal/console/claim_invariant_fixtures_test.go
@@ -442,7 +442,7 @@ func (cx *claimCase) scanObjectStaged(t *testing.T) {
if err != nil || rec == nil || rec.Provisioned == nil {
t.Fatalf("granted store record %+v %v", rec, err)
}
- cx.scanFake.PutObject(rec.Provisioned.Bucket, "claim-fixture.txt", `"claim-fixture"`, time.Now().Add(-time.Hour), 3)
+ cx.scanFake.PutObject(rec.Provisioned.Bucket, "claim-fixture.txt", `"claim-fixture"`, claimFixtureModified, 3)
}
// scanQueued stages one on-demand item for the drain to read.
diff --git a/internal/console/claim_invariant_world_test.go b/internal/console/claim_invariant_world_test.go
index 6f3ec9727..e53dc5f6a 100644
--- a/internal/console/claim_invariant_world_test.go
+++ b/internal/console/claim_invariant_world_test.go
@@ -631,11 +631,20 @@ func claimSafeName(s string) string {
// scanner's Scan rather than finishing on an empty bucket.
type claimOneObjectLister struct{}
+// claimFixtureModified is claim-fixture.txt's last-modified time, fixed: an
+// object's version is its ETag and its Modified to the second
+// (ScanObject.Version), and the lister and scanObjectStaged each took
+// time.Now() an hour back. When a second ticked between the stage and the
+// sweep's listing, the sweep recorded its verdict on another version than
+// the scanner held, and the scan/object probe read "pending" (CI under
+// load, TestClaimConsoleMutationInvariant).
+var claimFixtureModified = time.Date(2026, 10, 1, 12, 0, 0, 0, time.UTC)
+
func (claimOneObjectLister) ListPage(_ context.Context, _, startAfter string, _ int32) ([]objstore.ScanObject, bool, error) {
if startAfter != "" {
return nil, false, nil
}
- return []objstore.ScanObject{{Key: "claim-fixture.txt", ETag: `"claim-fixture"`, Size: 3, Modified: time.Now().Add(-time.Hour)}}, false, nil
+ return []objstore.ScanObject{{Key: "claim-fixture.txt", ETag: `"claim-fixture"`, Size: 3, Modified: claimFixtureModified}}, false, nil
}
// enroll stages an existing, open incarnation: the console's row bound to