Repository navigation
M7: the conformance suite, and the C1–C15 checklist - #45
Merged
Merged
Conversation
The spec's test guidance (conformance §5) as a named suite, as docs/8-quality.md §2.2 plans it: routing vectors, a split or merge during active produce and consume, a broker failover, cumulative ack across segments, and checkpoint round trips across a layout change. tests/conformance/README.md describes each case for any SDK, and lists, for each of C1–C15, the tests that show this client meets it. The cases against a 5.0.1 broker are integration trials named conformance::<id>. Four existing tests moved into the suite's table rather than being written again; the vector cases are the protocol crate's tests. New cases: the same key to the same segment from Rust's and Java's producers on a layout of uneven ranges (RoutingTool.java); a split and a merge under load, with a Queue and a Stream consumer reading; a failover by namespace unload and one by killing and restarting the broker, with a producer and the three consumers active; a Stream consumer's cumulative ack settling what came before it on every segment, a sealed one included, and nothing after. The broker restart runs once the other trials are done, one at a time, in a second libtest-mimic run: Env::restart_broker kills the broker container and starts it again.
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.
The spec's test guidance (conformance §5) as a named suite, as
docs/8-quality.md§2.2 plans it: routing vectors, a split or merge during active produce and consume, a broker failover, cumulative ack across segments, and checkpoint round trips across a layout change. This is one of M7's two checks (PLAN.md);tests/PORTING.mdfollows in its own PR.tests/conformance/README.mddoes two things:The cases against a 5.0.1 broker are integration trials named
conformance::<id>:Reused tests
Where an existing test already covered a case, it moved into the suite's table rather than being written again:
keys_keep_their_order_across_a_splitconformance::split_during_producea_split_during_consumption_loses_no_messageconformance::split_during_consumea_partitioned_topic_routes_like_v4conformance::legacy_routinga_checkpoint_round_trips_with_java_across_layout_changesconformance::checkpoint_round_trip_across_layout_changesThe vector cases are the protocol crate's existing tests (
routing_vectors,message_id_vectors,checkpoint_vectors).New cases
routing_across_clients: the layout has five segments of two sizes (four, then one split). Rust's producer and Java's (a newRoutingTool.java) each send the same 128 keys. Each key lands in the same segment for both: the one whose range holds the key's hash in the layoutget-metadatareturns.split_and_merge_under_load: a producer sends 16 keys without pause, with sends in flight, while a segment splits and its children merge back. A Queue and a Stream consumer receive meanwhile. No send fails, the Queue consumer gets every message once from segments 0 to 4, and the Stream consumer gets every key in order.failover_by_unloadandfailover_by_broker_restart: a producer with no send timeout, and a Queue, a Stream and a Checkpoint consumer, all active while the topic fails over. In the first, the namespace is unloaded; the test checks in the topic's stats that the producer registered again on both segments. In the second, the broker is killed and started again. No send fails, and each consumer gets every message; the Stream and Checkpoint consumers get each key in order. A message may come twice after a failover; only its first delivery is checked.cumulative_ack_across_segments: a Stream consumer receives from two segments in turn. Its ack of the tenth message settles the nine before it on both segments and nothing after: the backlog shows it, and a new consumer gets exactly the rest. Then segment 0 splits with delivered, unacknowledged messages. The children's messages wait until the ack of a message from the other segment drains the sealed parent.Harness
The broker restart can't share the broker with other tests, so cases in
conformance::EXCLUSIVErun after the others, one at a time, in a second libtest-mimic run.Env::restart_brokerkills the broker container and starts it again, then waits forbrokers healthcheck. That takes about 5 s locally and 10 s in a full run.Testing
cargo fmt, andclippy -D warningswith Rust 1.100 for the workspace. CI's clippy doesn't reach the integration target (test = false); with-A clippy::type_complexity, which every module'sTESTStable trips, it is clean too.