You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "hysuuuu (via GitHub)" <gi...@apache.org> on 2026/09/16 23:41:34 UTC
[PR] KAFKA-12188: Assert specific connection failure in SaslAuthenticatorTest [kafka]
hysuuuu opened a new pull request, #23485:
URL: https://github.com/apache/kafka/pull/23485
Previously, `SaslAuthenticatorTest` blindly caught `AssertionFailedError`. This allows unrelated assertion failures in `checkClientConnection` to pass the test.
Added an exact message check for "No disconnects should have occurred" to ensure the tests pass only when the server explicitly drops the connection, which is the expected behavior.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] KAFKA-12188: Assert specific connection failure in SaslAuthenticatorTest [kafka]
Posted by "chia7712 (via GitHub)" <gi...@apache.org>.
chia7712 commented on code in PR #23485:
URL: https://github.com/apache/kafka/pull/23485#discussion_r4222319815
##########
clients/src/test/java/org/apache/kafka/common/security/authenticator/SaslAuthenticatorTest.java:
##########
@@ -1613,7 +1613,9 @@ public void testCannotReauthenticateWithDifferentPrincipal() throws Exception {
* original token with a new one.
*/
delay(1000L);
- assertThrows(AssertionFailedError.class, () -> checkClientConnection(node));
+ AssertionFailedError e = assertThrows(AssertionFailedError.class, () -> checkClientConnection(node));
Review Comment:
please remove the extra space here and the trailing whitespace on the assertTrue lines :)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] KAFKA-12188: Assert specific connection failure in SaslAuthenticatorTest [kafka]
Posted by "chia7712 (via GitHub)" <gi...@apache.org>.
chia7712 commented on code in PR #23485:
URL: https://github.com/apache/kafka/pull/23485#discussion_r4222338653
##########
clients/src/test/java/org/apache/kafka/common/security/authenticator/SaslAuthenticatorTest.java:
##########
@@ -1733,7 +1735,9 @@ public void testCannotReauthenticateWithDifferentMechanism() throws Exception {
* to sleep long enough so that the next write will trigger a re-authentication.
*/
delay((long) (CONNECTIONS_MAX_REAUTH_MS_VALUE * 1.1));
- assertThrows(AssertionFailedError.class, () -> checkClientConnection(node));
+ AssertionFailedError e = assertThrows(AssertionFailedError.class, () -> checkClientConnection(node));
Review Comment:
This seems identical to the other test. Could you strip out the duplicate code with a helper method?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] KAFKA-12188: Assert specific connection failure in SaslAuthenticatorTest [kafka]
Posted by "chia7712 (via GitHub)" <gi...@apache.org>.
chia7712 merged PR #23485:
URL: https://github.com/apache/kafka/pull/23485
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] KAFKA-12188: Assert specific connection failure in SaslAuthenticatorTest [kafka]
Posted by "hysuuuu (via GitHub)" <gi...@apache.org>.
hysuuuu commented on code in PR #23485:
URL: https://github.com/apache/kafka/pull/23485#discussion_r4222690839
##########
clients/src/test/java/org/apache/kafka/common/security/authenticator/SaslAuthenticatorTest.java:
##########
@@ -1613,7 +1613,9 @@ public void testCannotReauthenticateWithDifferentPrincipal() throws Exception {
* original token with a new one.
*/
delay(1000L);
- assertThrows(AssertionFailedError.class, () -> checkClientConnection(node));
+ AssertionFailedError e = assertThrows(AssertionFailedError.class, () -> checkClientConnection(node));
Review Comment:
Thanks for the catch! Removed.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] KAFKA-12188: Assert specific connection failure in SaslAuthenticatorTest [kafka]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #23485:
URL: https://github.com/apache/kafka/pull/23485#issuecomment-5806895346
A label of 'needs-attention' was automatically added to this PR in order to raise the
attention of the committers. Once this issue has been triaged, the `triage` label
should be removed to prevent this automation from happening again.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] KAFKA-12188: Assert specific connection failure in SaslAuthenticatorTest [kafka]
Posted by "hysuuuu (via GitHub)" <gi...@apache.org>.
hysuuuu commented on code in PR #23485:
URL: https://github.com/apache/kafka/pull/23485#discussion_r4222713347
##########
clients/src/test/java/org/apache/kafka/common/security/authenticator/SaslAuthenticatorTest.java:
##########
@@ -1733,7 +1735,9 @@ public void testCannotReauthenticateWithDifferentMechanism() throws Exception {
* to sleep long enough so that the next write will trigger a re-authentication.
*/
delay((long) (CONNECTIONS_MAX_REAUTH_MS_VALUE * 1.1));
- assertThrows(AssertionFailedError.class, () -> checkClientConnection(node));
+ AssertionFailedError e = assertThrows(AssertionFailedError.class, () -> checkClientConnection(node));
Review Comment:
Extracted it into a helper method in b1114d9. Thanks!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org