Repository navigation
test: opt-in broker-failure suite (just test-dr) - #114
Merged
Merged
Conversation
Runs against a 3-node Redpanda cluster, kills or pauses brokers mid-stream, and checks that no acked message is lost, commits catch up, liveness stays green, and commit_stall_sec rises during a full outage and resets after. Not collected by just test or test-ci.
The floors job runs pytest . and an explicit path bypasses testpaths, so it collected the DR suite and failed waiting for the 3-node cluster.
lesnik512
force-pushed
the
test/dr-suite
branch
from
October 28, 2026 13:17
7eade2c to
21dd5ec
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.
Adds
just test-dr, an opt-in suite that breaks brokers of a 3-node Redpanda cluster while messages are in flight and checks that at-least-once delivery holds.What it does
tests_dr/compose.ymlstarts three Redpanda nodes (fca-dr-0..2, external listeners on localhost 19092, 29092 and 39092). Each scenario creates a topic with replication factor 3 andmin.insync.replicas=2, produces withacks=all, and injects a fault through the docker CLI once the consumer is processing. It then restores the node(s), produces more, and waits for convergence.kill_non_coordinatordocker killone broker that is not the group coordinatorkill_coordinatordocker killthe group coordinatorpause_coordinatordocker pausethe group coordinatorkill_all_brokersdocker killall threeshutdown_during_full_outageEvery scenario asserts zero missing messages and zero commit lag at the end. The four fault scenarios also assert that
is_kafka_handler_healthynever reads False (sampled every 250 ms) and thatcommit_stall_secis back to 0 once commits converge.kill_all_brokersadditionally asserts thatcommit_stall_secgoes above 0 during the outage, which covers #113 end to end. Each scenario writes a JSON report totests_dr/results/(gitignored) with timings, stall numbers and a count of WARNING+ log lines.The app is wired in the README lifespan order:
FastStream(broker), theninitialize_concurrent_processing, thenbroker.start().The shutdown scenario catches
CancelledErrorfrombroker.stop(). aiokafka 0.14.0'sFetcher.close()sometimes raises it when no broker is reachable; this library has nothing to do with it. The workaround is tracked in #116.Why it stays out of
just testand CItests_dr/sits outsidetestpaths, sojust testandtest-cido not collect it (still 258 tests). It is also innorecursedirs, because thefloorsjob runspytest .and an explicit path skipstestpaths.pytest tests_drstill collects it. It has no__init__.py, so--cov=.does not count it against the 100% coverage floor; that is whyINP001is ignored for it.CI does not run it. The suite takes almost four minutes, needs three Redpanda containers and docker CLI access to kill and pause them, and depends on real timeouts and leader elections. On shared runners that is a likely source of flaky reds and slows every PR. It is meant to be run by hand after changing commit, rebalance or shutdown code; AGENTS.md says so.
just test-drruns on the host (it has to reach the docker CLI), passes-o addopts= -p no:randomlyso the scenarios run serially and in order, and always tears the cluster down through a shelltrap, including when a test fails.Checklist
just test-dr: 5 passed in 205 s locally (macOS, OrbStack), rebased on Log a non-retriable commit error once at ERROR and keep retrying it #115just test: 258 passed, nothing fromtests_drcollectedjust lint-ciclean (ruff, ty, eof-fixer)Local run numbers:
In
pause_coordinator, 491 produce calls timed out while the coordinator was paused. The suite counts only acked messages, so they do not show up as missing. The 1586 duplicates in the shutdown scenario are expected: offsets processed during the outage could not be committed, so the second app redelivers them.