PIP-468: V5 plumbing-knob test coverage#25695
Merged
merlimat merged 1 commit intoapache:masterfrom May 6, 2026
Merged
Conversation
Pin the V5 → v4 contract for the remaining low-risk plumbing knobs that the audit flagged as untested. Each setter is a one-line forwarder to the underlying v4 config; without these tests, a regression that broke the mapping would ship silently. V5ClientBuilderConfigTest: - listenerName, description, memoryLimit, openTelemetry. Each propagates from the V5 builder to the wrapped v4 ClientConfigurationData (verified via reflection on PulsarClientV5#v4Client + getConfiguration()). V5ClientLifecycleTest: - closeAsync() flips the v4 client to closed. - shutdown() delegates to v4 without throwing and is idempotent. (Note: v4's shutdown() is the "fast" path — it stops executors and releases connections but deliberately does not flip the client's state to Closed, so isClosed() can still return false. The contract for V5 here is just "delegate to v4 without throwing"; observable post-shutdown behaviour is v4's responsibility and is exercised by the v4 test suite.) - newTransactionAsync() resolves to a Transaction in OPEN state. V5ConsumerSubscriptionPropertiesTest: - subscriptionProperties(Map) propagates to every per-segment v4 Consumer via ConsumerConfigurationData.getSubscriptionProperties() (single-segment + 3-segment topics). V5MessageReplicationClustersTest: - MessageBuilder.replicationClusters(List) lands in the v4 message metadata. Verified by sending via V5, receiving via V5, and reflecting through the V5 MessageV5 wrapper to call MessageImpl.getReplicateTo() on the underlying v4 message.
dao-jun
approved these changes
May 6, 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
Pin the V5 → v4 contract for the remaining low-risk plumbing knobs the audit flagged as untested. Each setter is a one-line forwarder to the underlying v4 config; without these tests, a regression that broke the mapping would ship silently.
V5ClientBuilderConfigTestlistenerName,description,memoryLimit,openTelemetry— each propagates from the V5 builder to the wrapped v4ClientConfigurationData(verified via reflection onPulsarClientV5#v4Client+getConfiguration())V5ClientLifecycleTestcloseAsync()flips the v4 client to closed;shutdown()delegates to v4 without throwing (idempotent);newTransactionAsync()resolves to a Transaction in OPEN stateV5ConsumerSubscriptionPropertiesTestsubscriptionProperties(Map)propagates to every per-segment v4ConsumerConfigurationData(single-segment + 3-segment topics)V5MessageReplicationClustersTestMessageBuilder.replicationClusters(List)lands in the v4 message metadata. Verified by sending via V5, receiving via V5, and reflecting through theMessageV5wrapper to callMessageImpl.getReplicateTo()on the underlying v4 messageNote on
shutdown(): v4'sshutdown()is the "fast" path — it stops executors and releases connections but deliberately does not flip the client's state toClosed, soisClosed()can still returnfalseafterwards. The contract for V5 here is just "delegate to v4 without throwing"; observable post-shutdown behaviour is v4's responsibility and is exercised by the v4 test suite.Test plan
pulsar-brokercheckstyle clean.