[feat] PIP-468: V5 flow-control knob test coverage#25689
Merged
merlimat merged 1 commit intoapache:masterfrom May 6, 2026
Merged
[feat] PIP-468: V5 flow-control knob test coverage#25689merlimat merged 1 commit intoapache:masterfrom
merlimat merged 1 commit intoapache:masterfrom
Conversation
Coverage gap from the V5 audit. The plumbing was wired but never exercised — these tests pin the V5 → v4 contract for four flow-control knobs that were previously easy to silently break. V5ConsumerPriorityLevelTest: - High + low priority consumers on a Shared subscription. With prefetch drained by acks, the high-priority consumer receives every message; with prefetch full (no acks), the broker overflows to the low one. - Single-segment topic to keep per-segment dispatch deterministic. V5ConsumerReceiverQueueSizeTest: - receiverQueueSize(int) propagates from the V5 builder to every per-segment v4 ConsumerImpl. Verified via reflection on segmentConsumers + ConsumerBase.getCurrentReceiverQueueSize(). - Covers both single-segment and 3-segment topics. V5ProducerFlowControlTest: - sendTimeout(Duration) and blockIfQueueFull(boolean) propagate from the V5 builder to every per-segment v4 ProducerImpl. Verified via reflection on segmentProducers + ProducerBase#conf. - Tests cover blockIfQueueFull(true), blockIfQueueFull(false), single-segment sendTimeout, and 3-segment sendTimeout. - Sends warm-up messages before reading state because V5 segment producers are created lazily on first send. Behavioural verification of the actual timeout-firing and queue-full paths still lives in the v4 test suite (SimpleProducerConsumerTest .testSendTimeout etc.); those tests stop the broker mid-send to force the pending-queue overflow / timeout, which the in-process shared cluster used here cannot do. The plumbing tests added here suffice as a regression guard for the V5 → v4 mapping.
lhotari
approved these changes
May 5, 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.
Summary
Coverage gap from the V5 audit — the plumbing for these knobs was wired but never exercised in any test, so a regression that broke the V5 → v4 mapping would have shipped silently. Pins the contract for four flow-control settings.
V5ConsumerPriorityLevelTestV5ConsumerReceiverQueueSizeTestreceiverQueueSize(int)propagates from the V5 builder to every per-segment v4ConsumerImpl— verified via reflection onsegmentConsumers+ConsumerBase.getCurrentReceiverQueueSize(). Covers single-segment and 3-segment topics.V5ProducerFlowControlTestsendTimeout(Duration)andblockIfQueueFull(boolean)propagate from the V5 builder to every per-segment v4ProducerImpl— verified via reflection onsegmentProducers+ProducerBase#conf. Tests coverblockIfQueueFull(true),blockIfQueueFull(false), single-segmentsendTimeout, and 3-segmentsendTimeout. Sends warm-up messages before reading state because V5 segment producers are created lazily on first send.Why config-propagation tests for the producer knobs and not behavioral? Behavioral verification of the actual timeout-firing and queue-full paths lives in the v4 test suite (
SimpleProducerConsumerTest.testSendTimeoutetc.); those tests stop the broker mid-send to force the pending-queue overflow / timeout, which the in-processSharedPulsarBaseTestcluster used here cannot do. The plumbing tests added here suffice as a regression guard for the V5 → v4 mapping.Test plan
pulsar-brokercheckstyle clean.