github-actions[bot] commented on code in PR #62679:
URL: https://github.com/apache/doris/pull/62679#discussion_r3128349167
##########
fe/fe-core/src/test/java/org/apache/doris/mysql/ConnectionExceedTest.java:
##########
@@ -90,6 +97,32 @@ public void testHandleConnectionExceed() throws Exception {
}
}
+ @Test
+ public void testHandleReadEventRejectedExecution() throws Exception {
+ try (MockedStatic<XnioIoThread> mockedIoThread =
Mockito.mockStatic(XnioIoThread.class)) {
+ ConnectContext context = Mockito.mock(ConnectContext.class);
+ QueryState queryState = Mockito.mock(QueryState.class);
+ ConnectProcessor processor = Mockito.mock(ConnectProcessor.class);
+ ConduitStreamSourceChannel channel =
Mockito.mock(ConduitStreamSourceChannel.class);
+ XnioWorker worker = Mockito.mock(XnioWorker.class);
+
+ Mockito.when(context.getState()).thenReturn(queryState);
+ Mockito.when(channel.getWorker()).thenReturn(worker);
+ Mockito.doThrow(new RejectedExecutionException("queue full"))
+ .when(worker).execute(Mockito.any(Runnable.class));
+
+ ReadListener listener = new ReadListener(context, processor);
+ listener.handleEvent(channel);
Review Comment:
These lines do not actually verify order. Each `Mockito.inOrder(context)`
call creates a new `InOrder` verifier, so the assertions only prove that the
four methods were each invoked at some point. If `setKilled()` moved before
`setThreadLocalInfo()` again, this test would still pass. Since the regression
here is about lifecycle ordering, please create one shared `InOrder` and verify
all four calls through it.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]