-
Notifications
You must be signed in to change notification settings - Fork 4.8k
HIVE-26089: ported TestAsyncPbRpcProxy to junit5, front-loaded JVM warmup and un-ignored a test #6733
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
konstantinb
wants to merge
6
commits into
apache:master
Choose a base branch
from
konstantinb:HIVE-26089
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+40
−19
Open
HIVE-26089: ported TestAsyncPbRpcProxy to junit5, front-loaded JVM warmup and un-ignored a test #6733
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
5042ae5
HIVE-26089: ported to junit5, front-loaded JVM warup and un-ignored a…
konstantinb 3ede89b
HIVE-26089: SQ feedback
konstantinb 931c4ce
HIVE-26089: trigger CI re-run
konstantinb 3b9e5f9
HIVE-26089: PR feedback
konstantinb 253e72d
HIVE-26089: trigger CI re-run
konstantinb bf45fb8
HIVE-26089: PR feedback - converting to milliseconds
konstantinb File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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); | ||
|
Comment on lines
+56
to
+57
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 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 |
||
| } | ||
|
|
||
| @Test (timeout = 5000) | ||
| public void testMultipleNodes() throws Exception { | ||
| @Test | ||
| @Timeout(value = 5000, unit = TimeUnit.MILLISECONDS, threadMode = Timeout.ThreadMode.SEPARATE_THREAD) | ||
| void testMultipleNodes() throws Exception { | ||
| RequestManagerForTest requestManager = new RequestManagerForTest(1); | ||
|
|
||
| LlapNodeId nodeId1 = LlapNodeId.getInstance("host1", 1025); | ||
|
|
@@ -59,16 +80,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 = 5000, unit = TimeUnit.MILLISECONDS, threadMode = Timeout.ThreadMode.SEPARATE_THREAD) | ||
| void testSingleInvocationPerNode() throws Exception { | ||
| RequestManagerForTest requestManager = new RequestManagerForTest(1); | ||
|
|
||
| LlapNodeId nodeId1 = LlapNodeId.getInstance("host1", 1025); | ||
|
|
@@ -83,7 +104,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 +113,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 +123,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)); | ||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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