Repository navigation
test(app): warm the sync status test's backend before its wire starts - #1981
Merged
Merged
Conversation
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]>
Merged
5 of 6 tasks
Collaborator
Author
|
CI notes for this test-only change. The PR gate (run 40414584346) is red for reasons outside this PR:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
A post-merge manual check of #1971 ran its tests under
-racelocally, which CI does not do.TestC6AppSyncQuietOffAndUnavailableStayLocalreported a data race.The test swaps the engine availability answer (
cell.UseAvailabilityInTests(false)) while the appwire server's backgroundWarmreads it. The read iscell.UnavailableReasonviaopenV3Process→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 asappkeylate_test.goandappproviders_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/codeafclean, gofmt clean🤖 Generated with Claude Code