From 5042ae5b1545e649e7c54445fd486d78a795ce7f Mon Sep 17 00:00:00 2001 From: Konstantin Bereznyakov Date: Thu, 27 Aug 2026 13:13:12 -0700 Subject: [PATCH 1/7] HIVE-26089: ported to junit5, front-loaded JVM warup and un-ignored a test --- .../hadoop/hive/llap/TestAsyncPbRpcProxy.java | 49 +++++++++++++------ 1 file changed, 33 insertions(+), 16 deletions(-) diff --git a/llap-client/src/test/org/apache/hadoop/hive/llap/TestAsyncPbRpcProxy.java b/llap-client/src/test/org/apache/hadoop/hive/llap/TestAsyncPbRpcProxy.java index 03cee59d66d3..ec7a1f20b213 100644 --- a/llap-client/src/test/org/apache/hadoop/hive/llap/TestAsyncPbRpcProxy.java +++ b/llap-client/src/test/org/apache/hadoop/hive/llap/TestAsyncPbRpcProxy.java @@ -19,10 +19,10 @@ package org.apache.hadoop.hive.llap; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; import static org.mockito.Mockito.mock; import java.util.HashMap; @@ -32,13 +32,30 @@ import org.apache.commons.lang3.mutable.MutableInt; import org.apache.hadoop.hive.llap.LlapNodeId; import org.apache.hadoop.hive.llap.tez.LlapProtocolClientProxy; -import org.junit.Assert; -import org.junit.Test; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.Timeout; public class TestAsyncPbRpcProxy { - @Test (timeout = 5000) - public void testMultipleNodes() throws Exception { + /** + * Front-loads one-time initialization (Mockito mock generation, classloading, log4j2 + * setup) so the per-test timeouts guard only the code under test. A timeout here + * indicates a starved executor, not a test bug (HIVE-26089). + */ + @BeforeAll + @Timeout(value = 60, threadMode = Timeout.ThreadMode.SEPARATE_THREAD) + static void warmUp() { + mock(Message.class); + mock(LlapProtocolClientProxy.ExecuteRequestCallback.class); + org.slf4j.LoggerFactory.getLogger(TestAsyncPbRpcProxy.class).info("warm-up"); + new RequestManagerForTest(1); + LlapNodeId.getInstance("warmup-host", 1025); + } + + @Test + @Timeout(value = 5, threadMode = Timeout.ThreadMode.SEPARATE_THREAD) + void testMultipleNodes() throws Exception { RequestManagerForTest requestManager = new RequestManagerForTest(1); LlapNodeId nodeId1 = LlapNodeId.getInstance("host1", 1025); @@ -59,16 +76,16 @@ public void testMultipleNodes() throws Exception { assertEquals(2, requestManager.numSubmissionsCounters); assertNotNull(requestManager.numInvocationsPerNode.get(nodeId1)); assertNotNull(requestManager.numInvocationsPerNode.get(nodeId2)); - Assert.assertEquals(1, requestManager.numInvocationsPerNode.get(nodeId1).getValue().intValue()); - Assert.assertEquals(1, requestManager.numInvocationsPerNode.get(nodeId2).getValue().intValue()); + assertEquals(1, requestManager.numInvocationsPerNode.get(nodeId1).getValue().intValue()); + assertEquals(1, requestManager.numInvocationsPerNode.get(nodeId2).getValue().intValue()); assertEquals(0, requestManager.currentLoopSkippedRequests.size()); assertEquals(0, requestManager.currentLoopSkippedRequests.size()); assertEquals(0, requestManager.currentLoopDisabledNodes.size()); } - @org.junit.Ignore("HIVE-26089") - @Test(timeout = 5000) - public void testSingleInvocationPerNode() throws Exception { + @Test + @Timeout(value = 5, threadMode = Timeout.ThreadMode.SEPARATE_THREAD) + void testSingleInvocationPerNode() throws Exception { RequestManagerForTest requestManager = new RequestManagerForTest(1); LlapNodeId nodeId1 = LlapNodeId.getInstance("host1", 1025); @@ -83,7 +100,7 @@ public void testSingleInvocationPerNode() throws Exception { requestManager.process(); assertEquals(1, requestManager.numSubmissionsCounters); assertNotNull(requestManager.numInvocationsPerNode.get(nodeId1)); - Assert.assertEquals(1, requestManager.numInvocationsPerNode.get(nodeId1).getValue().intValue()); + assertEquals(1, requestManager.numInvocationsPerNode.get(nodeId1).getValue().intValue()); assertEquals(0, requestManager.currentLoopSkippedRequests.size()); // Second request for host. Single invocation since the last has not completed. @@ -92,7 +109,7 @@ public void testSingleInvocationPerNode() throws Exception { requestManager.process(); assertEquals(1, requestManager.numSubmissionsCounters); assertNotNull(requestManager.numInvocationsPerNode.get(nodeId1)); - Assert.assertEquals(1, requestManager.numInvocationsPerNode.get(nodeId1).getValue().intValue()); + assertEquals(1, requestManager.numInvocationsPerNode.get(nodeId1).getValue().intValue()); assertEquals(1, requestManager.currentLoopSkippedRequests.size()); assertEquals(1, requestManager.currentLoopDisabledNodes.size()); assertTrue(requestManager.currentLoopDisabledNodes.contains(nodeId1)); @@ -102,7 +119,7 @@ public void testSingleInvocationPerNode() throws Exception { requestManager.process(); assertEquals(2, requestManager.numSubmissionsCounters); assertNotNull(requestManager.numInvocationsPerNode.get(nodeId1)); - Assert.assertEquals(2, requestManager.numInvocationsPerNode.get(nodeId1).getValue().intValue()); + assertEquals(2, requestManager.numInvocationsPerNode.get(nodeId1).getValue().intValue()); assertEquals(0, requestManager.currentLoopSkippedRequests.size()); assertEquals(0, requestManager.currentLoopDisabledNodes.size()); assertFalse(requestManager.currentLoopDisabledNodes.contains(nodeId1)); From 3ede89bb865ab03336e431baaeacfa96e4f0264d Mon Sep 17 00:00:00 2001 From: Konstantin Bereznyakov Date: Thu, 27 Aug 2026 18:30:08 -0700 Subject: [PATCH 2/7] HIVE-26089: SQ feedback --- .../test/org/apache/hadoop/hive/llap/TestAsyncPbRpcProxy.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/llap-client/src/test/org/apache/hadoop/hive/llap/TestAsyncPbRpcProxy.java b/llap-client/src/test/org/apache/hadoop/hive/llap/TestAsyncPbRpcProxy.java index ec7a1f20b213..3f7776f108ab 100644 --- a/llap-client/src/test/org/apache/hadoop/hive/llap/TestAsyncPbRpcProxy.java +++ b/llap-client/src/test/org/apache/hadoop/hive/llap/TestAsyncPbRpcProxy.java @@ -36,7 +36,7 @@ import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Timeout; -public class TestAsyncPbRpcProxy { +class TestAsyncPbRpcProxy { /** * Front-loads one-time initialization (Mockito mock generation, classloading, log4j2 From 931c4cee6e856ba46e1dde5450f081c550d15b1a Mon Sep 17 00:00:00 2001 From: Konstantin Bereznyakov Date: Thu, 27 Aug 2026 23:32:08 -0700 Subject: [PATCH 3/7] HIVE-26089: trigger CI re-run From 3b9e5f9df8efccb59df54fb5f7ab0adcb1babdb2 Mon Sep 17 00:00:00 2001 From: Konstantin Bereznyakov Date: Fri, 28 Aug 2026 08:34:47 -0700 Subject: [PATCH 4/7] HIVE-26089: PR feedback --- .../org/apache/hadoop/hive/llap/TestAsyncPbRpcProxy.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/llap-client/src/test/org/apache/hadoop/hive/llap/TestAsyncPbRpcProxy.java b/llap-client/src/test/org/apache/hadoop/hive/llap/TestAsyncPbRpcProxy.java index 3f7776f108ab..5763a22c94cc 100644 --- a/llap-client/src/test/org/apache/hadoop/hive/llap/TestAsyncPbRpcProxy.java +++ b/llap-client/src/test/org/apache/hadoop/hive/llap/TestAsyncPbRpcProxy.java @@ -30,14 +30,17 @@ import com.google.protobuf.Message; import org.apache.commons.lang3.mutable.MutableInt; -import org.apache.hadoop.hive.llap.LlapNodeId; import org.apache.hadoop.hive.llap.tez.LlapProtocolClientProxy; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Timeout; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; class TestAsyncPbRpcProxy { + private static final Logger LOG = LoggerFactory.getLogger(TestAsyncPbRpcProxy.class); + /** * Front-loads one-time initialization (Mockito mock generation, classloading, log4j2 * setup) so the per-test timeouts guard only the code under test. A timeout here @@ -48,7 +51,7 @@ class TestAsyncPbRpcProxy { static void warmUp() { mock(Message.class); mock(LlapProtocolClientProxy.ExecuteRequestCallback.class); - org.slf4j.LoggerFactory.getLogger(TestAsyncPbRpcProxy.class).info("warm-up"); + LOG.info("warm-up"); new RequestManagerForTest(1); LlapNodeId.getInstance("warmup-host", 1025); } From 253e72db7674f942e6d7ad2cceeca5dad9fd9324 Mon Sep 17 00:00:00 2001 From: Konstantin Bereznyakov Date: Sat, 29 Aug 2026 11:43:16 -0700 Subject: [PATCH 5/7] HIVE-26089: trigger CI re-run From bf45fb860b67d535ebfece5309c52ea8abc4e7ff Mon Sep 17 00:00:00 2001 From: Konstantin Bereznyakov Date: Sun, 30 Aug 2026 23:28:00 -0700 Subject: [PATCH 6/7] HIVE-26089: PR feedback - converting to milliseconds --- .../org/apache/hadoop/hive/llap/TestAsyncPbRpcProxy.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/llap-client/src/test/org/apache/hadoop/hive/llap/TestAsyncPbRpcProxy.java b/llap-client/src/test/org/apache/hadoop/hive/llap/TestAsyncPbRpcProxy.java index 5763a22c94cc..5a5db678d9bf 100644 --- a/llap-client/src/test/org/apache/hadoop/hive/llap/TestAsyncPbRpcProxy.java +++ b/llap-client/src/test/org/apache/hadoop/hive/llap/TestAsyncPbRpcProxy.java @@ -27,6 +27,7 @@ import java.util.HashMap; import java.util.Map; +import java.util.concurrent.TimeUnit; import com.google.protobuf.Message; import org.apache.commons.lang3.mutable.MutableInt; @@ -47,7 +48,7 @@ class TestAsyncPbRpcProxy { * indicates a starved executor, not a test bug (HIVE-26089). */ @BeforeAll - @Timeout(value = 60, threadMode = Timeout.ThreadMode.SEPARATE_THREAD) + @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS, threadMode = Timeout.ThreadMode.SEPARATE_THREAD) static void warmUp() { mock(Message.class); mock(LlapProtocolClientProxy.ExecuteRequestCallback.class); @@ -57,7 +58,7 @@ static void warmUp() { } @Test - @Timeout(value = 5, threadMode = Timeout.ThreadMode.SEPARATE_THREAD) + @Timeout(value = 5000, unit = TimeUnit.MILLISECONDS, threadMode = Timeout.ThreadMode.SEPARATE_THREAD) void testMultipleNodes() throws Exception { RequestManagerForTest requestManager = new RequestManagerForTest(1); @@ -87,7 +88,7 @@ void testMultipleNodes() throws Exception { } @Test - @Timeout(value = 5, threadMode = Timeout.ThreadMode.SEPARATE_THREAD) + @Timeout(value = 5000, unit = TimeUnit.MILLISECONDS, threadMode = Timeout.ThreadMode.SEPARATE_THREAD) void testSingleInvocationPerNode() throws Exception { RequestManagerForTest requestManager = new RequestManagerForTest(1); From 2b0e0cd760171314302abebc0b0c6b96e6d93983 Mon Sep 17 00:00:00 2001 From: Konstantin Bereznyakov Date: Tue, 1 Sep 2026 09:00:50 -0700 Subject: [PATCH 7/7] HIVE-26089: minimalistic warmup --- .../hadoop/hive/llap/TestAsyncPbRpcProxy.java | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/llap-client/src/test/org/apache/hadoop/hive/llap/TestAsyncPbRpcProxy.java b/llap-client/src/test/org/apache/hadoop/hive/llap/TestAsyncPbRpcProxy.java index 5a5db678d9bf..d352963797ed 100644 --- a/llap-client/src/test/org/apache/hadoop/hive/llap/TestAsyncPbRpcProxy.java +++ b/llap-client/src/test/org/apache/hadoop/hive/llap/TestAsyncPbRpcProxy.java @@ -35,26 +35,26 @@ import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Timeout; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; class TestAsyncPbRpcProxy { - private static final Logger LOG = LoggerFactory.getLogger(TestAsyncPbRpcProxy.class); - /** - * Front-loads one-time initialization (Mockito mock generation, classloading, log4j2 - * setup) so the per-test timeouts guard only the code under test. A timeout here - * indicates a starved executor, not a test bug (HIVE-26089). + * Front-loads one-time initialization (Mockito, log4j2 (transitively), classloading) that would + * otherwise happen inside the first test's timeout window. A timeout here indicates a + * starved executor, not a test bug (HIVE-26089). */ @BeforeAll @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS, threadMode = Timeout.ThreadMode.SEPARATE_THREAD) static void warmUp() { + // Initializes Mockito (agent attach, mock-class generation). Mock classes are + // generated and cached per type, so warm both types the tests use. mock(Message.class); mock(LlapProtocolClientProxy.ExecuteRequestCallback.class); - LOG.info("warm-up"); + // Loads the RequestManager class hierarchy. Also initializes log4j2, because the + // constructor touches a logger (via AsyncResponseHandler). new RequestManagerForTest(1); - LlapNodeId.getInstance("warmup-host", 1025); + // Loads the request classes and LlapNodeId, including its Guava cache. + new CallableRequestForTest(LlapNodeId.getInstance("warmup-host", 0), null, null); } @Test @@ -135,7 +135,7 @@ static class RequestManagerForTest extends LlapProtocolClientProxy.RequestManage int numSubmissionsCounters = 0; private Map numInvocationsPerNode = new HashMap<>(); - public RequestManagerForTest(int numThreads) { + RequestManagerForTest(int numThreads) { super(numThreads, 1); }