Skip to content

PIP-468: V5 plumbing-knob test coverage#25695

Merged
merlimat merged 1 commit intoapache:masterfrom
merlimat:st-v5-low-test-gap
May 6, 2026
Merged

PIP-468: V5 plumbing-knob test coverage#25695
merlimat merged 1 commit intoapache:masterfrom
merlimat:st-v5-low-test-gap

Conversation

@merlimat
Copy link
Copy Markdown
Contributor

@merlimat merlimat commented May 6, 2026

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.

Test class Tests What it covers
V5ClientBuilderConfigTest 4 listenerName, description, memoryLimit, openTelemetry — each propagates from the V5 builder to the wrapped v4 ClientConfigurationData (verified via reflection on PulsarClientV5#v4Client + getConfiguration())
V5ClientLifecycleTest 3 closeAsync() flips the v4 client to closed; shutdown() delegates to v4 without throwing (idempotent); newTransactionAsync() resolves to a Transaction in OPEN state
V5ConsumerSubscriptionPropertiesTest 2 subscriptionProperties(Map) propagates to every per-segment v4 ConsumerConfigurationData (single-segment + 3-segment topics)
V5MessageReplicationClustersTest 1 MessageBuilder.replicationClusters(List) lands in the v4 message metadata. Verified by sending via V5, receiving via V5, and reflecting through the MessageV5 wrapper to call MessageImpl.getReplicateTo() on the underlying v4 message

Note on shutdown(): 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 afterwards. 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

  • All 10 new tests pass.
  • Full V5 broker test suite green (143/143).
  • pulsar-broker checkstyle clean.

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.
@merlimat merlimat merged commit dcb41fd into apache:master May 6, 2026
79 of 82 checks passed
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.

2 participants