Repository navigation
tests: wait for the trust file instead of reading it the moment trust appears - #508
Merged
Merged
Conversation
#500 made TestHandshakeTrustLoadVerify and TestHandshakeTrustPersistence wait up to 2s for trust.json to exist. The handshake manager writes the file from a goroutine after the in-memory state changes, and its first write can still hold only the pending request, so LoadVerify could read a file with no trusted peer ("trust file should have at least one trusted peer"). It now waits for a write that lists one, and both tests allow 5s, which is what failed under load. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
TeoSlayer
force-pushed
the
tests/deflake-trust-file
branch
from
October 7, 2026 12:58
45d719a to
36eea9e
Compare
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.
What fails
TestHandshakeTrustLoadVerifyandTestHandshakeTrustPersistencefail intermittently when the machine is busy. Before #500 they readtrust.jsonthe moment the peer showed as trusted:#500 (merged) made both wait up to 2 s for the file to exist. That leaves one gap: the handshake manager writes the file from a goroutine after the in-memory state changes, and its first write can still contain only the pending request. LoadVerify can then read a file with no trusted peer and fail with "trust file should have at least one trusted peer".
Change (rebased onto v1.16.0)
Test-only; no product code changes.
./testsruns only locally since the nightly workflow was removed, so CI does not exercise this. Locally the two tests passed 5 of 5 runs after the rebase.🤖 Generated with Claude Code