Skip to content

M7, ports part 2: the producer, routing and message ids - #49

Merged
merlimat merged 1 commit into
mainfrom
m7-ports-producer
Nov 23, 2026
Merged

merlimat merged 1 commit into
mainfrom
m7-ports-producer

Conversation

@merlimat

Copy link
Copy Markdown
Contributor

Java V5 tests of the producer, routing and message ids, ported (PLAN.md, M7: tests/PORTING.md shows the Java scenarios in scope covered; that file follows in its own PR). Only test code changes.

Java Rust
V5AuthErrorTest.testProduceNotAuthorized (exclusive create) testkit producer_edges.rs::an_exclusive_create_refused_for_authorization_fails
V5AuthErrorTest.testLookupNotAuthorized (producer) producer_tests.rs::a_refused_lookup_fails_create
V5LayoutChangeDuringCreateTest.testProducerRoutesToChildrenOfSplitBeforeCreate producer_tests.rs::a_producer_created_after_a_split_sends_to_the_children
V5ProducerBackpressureTest.cancelledSendsGiveTheirReservationBackOnceDropped producer_tests.rs::dropped_sends_keep_their_room_until_they_complete
V5ProducerBackpressureTest.retriesAcrossASegmentSplitKeepTheAccountingBalanced producer_tests.rs::sends_waiting_for_room_go_through_a_split_and_give_it_back
V5ConcurrentProducersConsumersTest.testManyProducersAndConsumersConcurrent producer_tests.rs::concurrent_producers_and_consumers_get_every_message_once
ScalableTopicProducerOrderingTest.aLayoutAppliedWhileReleasingStopsTheRestOfTheBatch testkit producer.rs::messages_moved_to_a_child_that_splits_reach_the_grandchild_in_order
ScalableTopicProducerOrderingTest.closingTheClientWaitsForAProducerThatIsAlreadyClosing producer_tests.rs::closing_the_client_waits_for_a_producer_already_closing
SegmentRouterTest.testMixedLegacyAndRegularStillUsesHashRouting protocol layout.rs::a_legacy_segment_beside_a_managed_one_routes_by_hash_range
ClientSegmentLayoutTest.testControllerBrokerUrlPropagated protocol layout.rs::gives_the_controller_url_for_plain_or_tls_connections
MessageIdV5Test.testEqualsIgnoresPositionVector protocol message_id_vectors.rs::ids_hash_and_order_as_they_compare (extended)

Where Rust differs from Java, the tests pin Rust's behaviour:

  • A send future dropped after its first poll doesn't recall the message (MessageBuilder::send's rustdoc): it is stored, and its room in the memory limit comes back once it completes. Java drops a cancelled send at dispatch.
  • closing_the_client_waits_for_a_producer_already_closing holds the broker's answer to the producer's close with WorldServer::hold_output, a test helper added in producer_tests.rs.

Testing

  • Every workspace test passes, and each new or extended test passed 5 runs in a row.
  • Each new test was checked against a client broken on purpose, in the way it guards against: it fails.
  • cargo fmt; clippy -D warnings with Rust 1.100. No library code changes.

Java V5's tests of the producer, routing and message ids that had no Rust counterpart, ported
(PLAN.md, M7; tests/PORTING.md follows in its own PR): an exclusive create refused for
authorization, a refused lookup, a producer created after a split sending to the children,
dropped sends keeping their room in the memory limit until they complete, sends waiting for
room going through a split, concurrent producers and consumers getting every message once,
messages moved to a child that splits again reaching the grandchild in order, the client's
close waiting for a producer already closing, a legacy segment beside a managed one routing by
hash range, the controller's URL for plain and TLS connections, and ids hashing and ordering
as they compare. Only test code changes.
@merlimat
merlimat merged commit dacb3d7 into main Nov 23, 2026
15 checks passed
@merlimat
merlimat deleted the m7-ports-producer branch November 23, 2026 23:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant