abstractdog commented on code in PR #6733:
URL: https://github.com/apache/hive/pull/6733#discussion_r3892268821
##########
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:
could you add a pre/post warmup message if it could be interesting? I feel
that this message alone is not necessarily useful
if it's just for log4j warmup, it can also be noted by a code comment, but
still, a pre/post message makes sense to me, like beginning and end of this
whole method
##########
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:
please elaborate in a short code comment for later convenience what kind of
warm-up mechanism kicks in by calling these? if classloading, which set classes
approximately are about to load by this call
--
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]