konstantinb commented on code in PR #6733:
URL: https://github.com/apache/hive/pull/6733#discussion_r3908951320
##########
llap-client/src/test/org/apache/hadoop/hive/llap/TestAsyncPbRpcProxy.java:
##########
@@ -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;
-
-public class TestAsyncPbRpcProxy {
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.Timeout;
+
+class TestAsyncPbRpcProxy {
+
+ /**
+ * 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");
Review Comment:
Correction to the above: the final revision removed the logger entirely —
log4j2 initializes transitively in the RequestManagerForTest warm-up line
(noted in the comment there).
##########
llap-client/src/test/org/apache/hadoop/hive/llap/TestAsyncPbRpcProxy.java:
##########
@@ -19,26 +19,47 @@
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;
import java.util.Map;
+import java.util.concurrent.TimeUnit;
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.Assert;
-import org.junit.Test;
-
-public class TestAsyncPbRpcProxy {
+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).
+ */
+ @BeforeAll
+ @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS, threadMode =
Timeout.ThreadMode.SEPARATE_THREAD)
+ static void warmUp() {
+ mock(Message.class);
+ mock(LlapProtocolClientProxy.ExecuteRequestCallback.class);
+ LOG.info("warm-up");
Review Comment:
Went with the code-comment option you mentioned — under CPU-starvation
testing the log calls were not needed for the fix itself, so the final warm-up
carries no logger. Happy to re-add pre/post markers if you would like them
operationally.
##########
llap-client/src/test/org/apache/hadoop/hive/llap/TestAsyncPbRpcProxy.java:
##########
@@ -19,26 +19,47 @@
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;
import java.util.Map;
+import java.util.concurrent.TimeUnit;
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.Assert;
-import org.junit.Test;
-
-public class TestAsyncPbRpcProxy {
+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).
+ */
+ @BeforeAll
+ @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS, threadMode =
Timeout.ThreadMode.SEPARATE_THREAD)
+ static void warmUp() {
+ mock(Message.class);
+ mock(LlapProtocolClientProxy.ExecuteRequestCallback.class);
+ LOG.info("warm-up");
+ new RequestManagerForTest(1);
+ LlapNodeId.getInstance("warmup-host", 1025);
Review Comment:
Done — each warm-up line now carries a comment naming the mechanism and the
approximate class set it loads.
--
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]