github-actions[bot] commented on code in PR #68330:
URL: https://github.com/apache/doris/pull/68330#discussion_r4091020332


##########
fe/fe-core/src/test/java/org/apache/doris/catalog/EnvStateListenerTest.java:
##########
@@ -17,22 +17,49 @@
 
 package org.apache.doris.catalog;
 
+import org.apache.doris.common.Config;
 import org.apache.doris.common.util.Daemon;
+import org.apache.doris.datasource.CatalogMgr;
 import org.apache.doris.ha.FrontendNodeType;
+import org.apache.doris.metric.MetricRepo;
+import org.apache.doris.mysql.privilege.Auth;
+import org.apache.doris.statistics.analysis.AnalysisManager;
+import org.apache.doris.statistics.analysis.FollowerColumnSender;
+import org.apache.doris.statistics.cache.StatisticsCache;
 
 import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.Timeout;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.CsvSource;
+import org.mockito.MockedConstruction;
+import org.mockito.MockedStatic;
 import org.mockito.Mockito;
+import org.mockito.stubbing.Answer;
 
 import java.lang.reflect.Field;
+import java.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.List;
 import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.TimeUnit;
+import java.util.concurrent.atomic.AtomicBoolean;
 import java.util.concurrent.atomic.AtomicInteger;
 
+@Timeout(30)

Review Comment:
   [P2] Keep the timeout away from the listener's fatal interrupt path
   
   `@Timeout` uses JUnit's inferred mode, which [falls back to 
`SAME_THREAD`](https://docs.junit.org/5.14.0-RC1/user-guide/index.html#writing-tests-declarative-timeouts-thread-mode)
 here because the repository has no thread-mode override. This parameterized 
test later calls `runOneCycle(stateListener)` directly on that timed thread. If 
a regression consumes the duplicate sentinel without returning and blocks on 
the next `typeTransferQueue.take()`, the timeout interrupts `take()`; the 
production catch in `createStateListener()` then calls `System.exit(-1)`, 
terminating the Surefire fork instead of producing the bounded timeout failure 
this annotation is meant to provide. Please exercise the listener in its normal 
daemon thread with latch/sentinel cleanup, or expose a non-blocking 
single-transition step so the timed JUnit thread can never enter that fatal 
interrupt path.



-- 
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]

Reply via email to