Skip to content

M7, ports part 1: connections, authentication and client options - #48

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

merlimat merged 1 commit into
mainfrom
m7-ports-connections

Conversation

@merlimat

Copy link
Copy Markdown
Contributor

Java V5 tests of connections, authentication and the client's options, 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
ClientCnxAsyncAuthTest.refreshRepublishesCredentialWithoutDisconnect tests.rs::token_authentication_and_refresh (extended: a second refresh, one CONNECT)
ClientCnxAsyncAuthTest.staleRoundCompletionIsIgnored tests/driver.rs::a_refresh_supersedes_one_still_pending
ClientCnxAsyncAuthTest.refreshResetsChallengeRoundCounter testkit connection.rs::a_refresh_starts_the_challenge_rounds_over
ClientCnxAsyncAuthTest.continuationAfterChannelCloseDoesNotWrite tests/driver.rs::a_socket_closed_while_the_credential_is_fetched_fails_the_connection (Rust may write the CONNECT and learn of the close from the read: the connection fails with Connect, and nothing hangs)
BinaryAuthenticationExchangeTest (4) tests/driver.rs::only_a_refresh_is_answered_with_fresh_auth_data, testkit connection.rs::only_the_refresh_sentinel_asks_for_fresh_credentials
ClientAuthenticationLifecycleTest.closingTheClientClosesAV5NativePlugin tests.rs::closing_the_client_releases_its_authentication_provider
AuthInitializationRetryTest.anImmediatelyFailedInitializationIsRetriedOnTheNextConnection tests/driver.rs::a_provider_that_failed_is_asked_again_for_the_next_connection
PulsarClientBuilderV5Test.testRejectsHttpsWithGuidance testkit lookup.rs::service_urls (extended)
PulsarClientBuilderV5Test.testRejectsNullAndBlank tests/options.rs::the_builder_refuses_incomplete_or_contradictory_options (extended)

Not ported here:

  • ClientCnxAsyncAuthTest.connectWriteFailureFailsConnectionFutureWithWriteCause: nothing makes a loopback write fail.
  • AuthMetricsTest: the client records no metrics yet.
  • A provider failing at connect (connectCredentialFailureClosesChannelWithoutThrowing, asyncConnectCredentialFailureFailsConnectionFutureWithMappedCause): already covered by tests/driver.rs::a_failing_authentication_provider_is_an_authentication_failure, from the error-model audit (M7 audit, part 1: the error model #38).

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 connections, authentication and the client's options that had no Rust
counterpart, ported (PLAN.md, M7; tests/PORTING.md follows in its own PR): a refreshed
credential sent without reconnecting, a stale challenge round ignored, a refresh starting the
challenge rounds over, a socket closed while the credential is fetched, fresh auth data only
for a refresh, the provider released when the client closes, a provider that failed asked
again for the next connection, and the builder refusing an https:// service URL and
incomplete options. Only test code changes.
@merlimat
merlimat merged commit 70c2f29 into main Nov 23, 2026
15 checks passed
@merlimat
merlimat deleted the m7-ports-connections branch November 23, 2026 23:36
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