Skip to content

Commit 58ebd37

Browse files
committed
[test](fe) Move split-close RPC fixture outside the race timeout
### What problem does this PR solve? Issue Number: N/A Related PR: #69683 Problem Summary: The split-consumer close concurrency test initializes the large Env and frontend RPC service mocks inside its 30-second method timeout. CI logs show RPC static initialization still running after that budget, before the producer thread is created. Move these class fixtures to BeforeAll, following existing bounded-concurrency tests, so cold initialization does not consume the queue-race budget. Keep the original 30-second timeout, five-second phase bounds, close-race assertions, RPC idempotence, and executor cleanup unchanged. ### Release note None ### Check List (For Author) - Test: Unit Test: controlled 1-second budget fails before the fixture move and passes afterward; 63 related FE tests pass with the original 30-second limit; full FE packaging and Checkstyle via build.sh --fe - Behavior changed: No - Does this need documentation: No
1 parent b76e398 commit 58ebd37

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

‎fe/fe-core/src/test/java/org/apache/doris/datasource/SplitConsumerCloseTest.java‎

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
import com.google.common.collect.ArrayListMultimap;
2929
import com.google.common.collect.Multimap;
3030
import org.junit.jupiter.api.Assertions;
31+
import org.junit.jupiter.api.BeforeAll;
3132
import org.junit.jupiter.api.Test;
3233
import org.junit.jupiter.api.Timeout;
3334
import org.mockito.MockedStatic;
@@ -48,6 +49,16 @@
4849

4950
@Timeout(30)
5051
class SplitConsumerCloseTest {
52+
private static Env env;
53+
private static FrontendServiceImpl service;
54+
55+
@BeforeAll
56+
static void initializeRpcFixture() {
57+
// Keep Env/service cold initialization outside the bounded queue-close race.
58+
env = Mockito.mock(Env.class);
59+
service = Mockito.mock(FrontendServiceImpl.class, Mockito.CALLS_REAL_METHODS);
60+
}
61+
5162
@Test
5263
@SuppressWarnings("unchecked")
5364
void ownerCloseReleasesAFullBackendQueueWithoutDroppingOtherBackendSplits() throws Exception {
@@ -89,9 +100,7 @@ public boolean offer(TScanRangeLocations value, long timeout, TimeUnit unit) thr
89100
SplitSourceManager manager = new SplitSourceManager();
90101
manager.registerSplitSource(stoppedSource);
91102
manager.registerSplitSource(liveSource);
92-
Env env = Mockito.mock(Env.class);
93103
Mockito.when(env.getSplitSourceManager()).thenReturn(manager);
94-
FrontendServiceImpl service = Mockito.mock(FrontendServiceImpl.class, Mockito.CALLS_REAL_METHODS);
95104
ExecutorService executor = Executors.newSingleThreadExecutor();
96105
delayNext.set(true);
97106
try (MockedStatic<Env> mockedEnv = Mockito.mockStatic(Env.class)) {

0 commit comments

Comments
 (0)