commit | 31c31ab28e89eb3a165f4c4556d05ec782369e91 | [log] [tgz] |
---|---|---|
author | Yong Zhang <zhangyong1025.zy@gmail.com> | Wed Sep 16 21:39:56 2020 +0800 |
committer | GitHub <noreply@github.com> | Wed Sep 16 21:39:56 2020 +0800 |
tree | 9b31cc892d0c04d754df249d2f79dcedd1dad4aa | |
parent | d98eeb0835af7720853c0e4f1670973d25580b7a [diff] |
Cancel retry if the error is autheticate failed (#8058) --- Fixes #7929 *Motivation* We shouldn't retry to connect to the server if the client has authenticate error.
diff --git a/tests/integration/src/test/java/org/apache/pulsar/tests/integration/auth/token/PulsarTokenAuthenticationBaseSuite.java b/tests/integration/src/test/java/org/apache/pulsar/tests/integration/auth/token/PulsarTokenAuthenticationBaseSuite.java index ad0fa83..7a923ee 100644 --- a/tests/integration/src/test/java/org/apache/pulsar/tests/integration/auth/token/PulsarTokenAuthenticationBaseSuite.java +++ b/tests/integration/src/test/java/org/apache/pulsar/tests/integration/auth/token/PulsarTokenAuthenticationBaseSuite.java
@@ -329,4 +329,18 @@ } } } + + @Test + public void testAuthenticationFailedImmediately() throws PulsarClientException { + try { + @Cleanup + PulsarClient client = PulsarClient.builder() + .serviceUrl(pulsarCluster.getPlainTextServiceUrl()) + .authentication(AuthenticationFactory.token("invalid_token")) + .build(); + client.newProducer().topic("test_token_topic" + randomName(4)); + } catch (PulsarClientException.AuthenticationException pae) { + // expected error + } + } }