[dbsp] Fix flaky exchange wire-protocol tests under random fault injection - #6808
Merged
Conversation
…ction new_message_sent_without_waiting_after_a_ping and pings_repeatedly_without_retransmitting drive the wire protocol directly against a single hand-accepted TcpStream, so they can't tolerate the random inject_fault() connection drops meant for the round-based resilience tests: a dropped connection makes the client reconnect to a fresh socket the test never accepts, leaving it reading a dead stream and panicking on an unexpected None. This fixes the problem by disabling fault injection while the tests that can tolerate it run. These tests run quickly, so other tests can still benefit from fault injection. Signed-off-by: Ben Pfaff <blp@feldera.com>
mihaibudiu
approved these changes
Aug 5, 2026
mythical-fred
approved these changes
Aug 5, 2026
mythical-fred
left a comment
There was a problem hiding this comment.
Correct fix: the two protocol-level tests drive a hand-accepted TcpStream and have no way to recover from a inject_fault() disconnect. A refcounted FAULT_INJECTION_DISABLE_COUNT toggled by an RAII FaultInjectionDisabled guard is exactly the right shape — nests safely, unwinds cleanly on panic, and leaves the round-based resilience tests unchanged.
The scoping is tight (two tests, both fast, both explicitly commented as protocol-level) so fault injection still covers the tests it was designed for.
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.
new_message_sent_without_waiting_after_a_ping and
pings_repeatedly_without_retransmitting drive the wire protocol directly against a single hand-accepted TcpStream, so they can't tolerate the random inject_fault() connection drops meant for the round-based resilience tests: a dropped connection makes the client reconnect to a fresh socket the test never accepts, leaving it reading a dead stream and panicking on an unexpected None.
This fixes the problem by disabling fault injection while the tests that can tolerate it run. These tests run quickly, so other tests can still benefit from fault injection.
Describe Manual Test Plan
Ran the tests
Checklist