You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2022/08/17 06:17:24 UTC

[GitHub] [pulsar] HQebupt commented on a diff in pull request #17084: [improve][broker]add ServerCnx state check before server handle request

HQebupt commented on code in PR #17084:
URL: https://github.com/apache/pulsar/pull/17084#discussion_r947491894


##########
pulsar-broker/src/test/java/org/apache/pulsar/broker/service/ServerCnxTest.java:
##########
@@ -2153,4 +2167,157 @@ public void testHandleAuthResponseWithoutClientVersion() {
         verify(authResponse, times(1)).hasClientVersion();
         verify(authResponse, times(0)).getClientVersion();
     }
+
+    @Test(expectedExceptions = IllegalArgumentException.class)
+    void shouldFailHandleLookup() throws Exception {
+        resetChannel();
+        Field stateUpdater = ServerCnx.class.getDeclaredField("state");
+        stateUpdater.setAccessible(true);
+        stateUpdater.set(serverCnx, ServerCnx.State.Failed);
+
+        CommandLookupTopic commandLookupTopic = spy(CommandLookupTopic.class);
+        serverCnx.handleLookup(commandLookupTopic);

Review Comment:
   Good



-- 
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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org