Skip to content

test(app): warm the sync status test's backend before its wire starts - #1981

Merged
AbirAbbas merged 1 commit into
app/v3from
fix/appsync-test-warm-race
Oct 27, 2026
Merged

AbirAbbas merged 1 commit into
app/v3from
fix/appsync-test-warm-race

Conversation

@AbirAbbas

Copy link
Copy Markdown
Collaborator

Summary

A post-merge manual check of #1971 ran its tests under -race locally, which CI does not do. TestC6AppSyncQuietOffAndUnavailableStayLocal reported a data race.

The test swaps the engine availability answer (cell.UseAvailabilityInTests(false)) while the appwire server's background Warm reads it. The read is cell.UnavailableReason via openV3Process → v3Memory.

The fix calls b.Warm() once before the wire starts. That makes the server's own warm-up a no-op, the same pattern as appkeylate_test.go and appproviders_test.go. It runs after the relay URL points at the test's counting server, so any relay request from warm-up would still fail the test's no-traffic check.

Test-only; no product code changes.

Test plan

  • go test -race -tags=engine ./cmd/codeaf -run '^TestC6AppSyncQuietOffAndUnavailableStayLocal$' -count=3: 3/3 pass, 0 data races (before: race reported in both race shards)
  • go vet -tags=engine ./cmd/codeaf clean, gofmt clean
  • CI gate (dispatched by hand, since PRs into app/v3 do not trigger it)

🤖 Generated with Claude Code

TestC6AppSyncQuietOffAndUnavailableStayLocal swaps the engine availability
answer mid-test while the appwire server's background Warm reads it, which
-race reports as a data race (cell.UnavailableReason vs
cell.UseAvailabilityInTests). Warming synchronously first makes the server's
own Warm a no-op, as appkeylate_test and appproviders_test already do. It
runs after the relay URL points at the counting server, so a request from
warm-up would still fail the test's no-traffic check.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@AbirAbbas

Copy link
Copy Markdown
Collaborator Author

CI notes for this test-only change. The PR gate (run 40414584346) is red for reasons outside this PR:

@AbirAbbas
AbirAbbas merged commit cfb27ba into app/v3 Oct 27, 2026
2 of 6 checks passed
@AbirAbbas
AbirAbbas deleted the fix/appsync-test-warm-race branch October 27, 2026 01:14
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