From 5042ae5b1545e649e7c54445fd486d78a795ce7f Mon Sep 17 00:00:00 2001 From: Konstantin Bereznyakov Date: Thu, 27 Aug 2026 13:13:12 -0700 Subject: [PATCH 1/4] 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/4] 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/4] 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/4] 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); }