Repository navigation
Fix flaky tests - #5482
Merged
Merged
Fix flaky tests#5482
Conversation
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Synthetic loopback duplicates can still perform flow-control completion bookkeeping twice and trigger an assertion.
1 open finding
What changed in this PR
Makes test-only flow-control bypass explicit, preventing flaky bookkeeping assertions.
Changes:
- Renames and propagates the bypass helper and flag.
- Skips outbound flow-control bookkeeping for bypassed messages.
- Updates overlay tests and adds a queue-state regression assertion.
| File | Description |
|---|---|
src/overlay/test/TCPPeerTests.cpp |
Uses the explicit bypass helper. |
src/overlay/test/OverlayTests.cpp |
Updates tests and verifies queue bypass. |
src/overlay/test/OverlayManagerTests.cpp |
Updates the peer stub interface. |
src/overlay/test/LoopbackPeer.h |
Extends the loopback transport interface. |
src/overlay/test/LoopbackPeer.cpp |
Propagates bypass state and skips bookkeeping. |
src/overlay/TCPPeer.h |
Extends the TCP transport interface. |
src/overlay/TCPPeer.cpp |
Tracks bypass state through asynchronous writes. |
src/overlay/Peer.h |
Adds test-only bypass state and API. |
src/overlay/Peer.cpp |
Implements the renamed bypass helper. |
🧠 Review effort: Balanced
Give feedback about Copilot approvals in this survey to enter a drawing for a $150 gift card.
graydon
force-pushed
the
fix-flaky-flow-control-bypass
branch
from
October 8, 2026 18:42
da7ae65 to
7d80a74
Compare
graydon
force-pushed
the
fix-flaky-flow-control-bypass
branch
from
October 9, 2026 23:47
3103ec7 to
07eb227
Compare
sisuresh
reviewed
Oct 10, 2026
graydon
force-pushed
the
fix-flaky-flow-control-bypass
branch
from
October 10, 2026 02:34
07eb227 to
104b92d
Compare
graydon
force-pushed
the
fix-flaky-flow-control-bypass
branch
from
October 10, 2026 04:31
104b92d to
20606d7
Compare
sisuresh
approved these changes
Oct 13, 2026
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.



We've had a flaky overlay test breaking CI runs for a while now (most recently https://github.com/stellar/stellar-core/actions/runs/37384282444/job/112013606376?pr=5479 in #5479). The root cause is a test helper that's used in a bunch of places that tries to bypass outbound flow control -- basically to emulate a misbehaving peer sending stuff they shouldn't send -- but doesn't necessarily maintain invariants expected by the flow control subsystem. As a result, one recently-added test has a nondeterministic/racy break of one of the invariants, so the test aborts with an assert failure from time to time.
This change renames the test helper method to clarify what it's supposed to be doing, and then modifies what it does to explicitly mark (in test-only code) outgoing messages that are supposed to bypass flow control and then .. just bypasses the flow control including the book-keeping code that has invariants to maintain.
At least, this is what sol-and-I discussed and implemented. I am fairly convinced it's correct. It also does seem to get rid of the failure (I ran the test in a loop, crashes before, no more crashes after). But I wouldn't mind careful and conceptual review!
I also included here a new, different workaround for the bug I tried but failed to fix in #5462 -- config.status getting stuck reconfiguring with unknown arguments accidentally promoted from gperftools. The previous fix didn't work, but hopefully this one does!
I also included a fix for another flaky test, "ledger state update flow with parallel apply", which has been periodically failing with a simulation timeout.