You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by bs...@apache.org on 2019/10/31 18:20:42 UTC

[hive] branch master updated: HIVE-22436: Tracking Flaky Test: TestBuddyAllocator.java see HIVE-22175 (Slim Bouguerra via Ashutosh Chauchan)

This is an automated email from the ASF dual-hosted git repository.

bslim pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hive.git


The following commit(s) were added to refs/heads/master by this push:
     new 9490264  HIVE-22436: Tracking Flaky Test: TestBuddyAllocator.java see HIVE-22175 (Slim Bouguerra via Ashutosh Chauchan)
9490264 is described below

commit 949026453eed68a4b2f25b64203be75c3459981c
Author: Slim Bouguerra <bs...@apache.org>
AuthorDate: Thu Oct 31 11:18:59 2019 -0700

    HIVE-22436: Tracking Flaky Test: TestBuddyAllocator.java see HIVE-22175 (Slim Bouguerra via Ashutosh Chauchan)
---
 .../hadoop/hive/llap/cache/TestBuddyAllocator.java | 26 ++++++++++++++++++----
 1 file changed, 22 insertions(+), 4 deletions(-)

diff --git a/llap-server/src/test/org/apache/hadoop/hive/llap/cache/TestBuddyAllocator.java b/llap-server/src/test/org/apache/hadoop/hive/llap/cache/TestBuddyAllocator.java
index 8b3ffdd..4662139 100644
--- a/llap-server/src/test/org/apache/hadoop/hive/llap/cache/TestBuddyAllocator.java
+++ b/llap-server/src/test/org/apache/hadoop/hive/llap/cache/TestBuddyAllocator.java
@@ -24,6 +24,7 @@ import java.util.Collection;
 import java.util.Random;
 import java.util.concurrent.Callable;
 import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.ExecutionException;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
 import java.util.concurrent.FutureTask;
@@ -110,7 +111,7 @@ public class TestBuddyAllocator {
     final int min = 3, max = 8, maxAlloc = 1 << max, allocsPerSize = 3;
     final BuddyAllocator a = new BuddyAllocator(isDirect, isMapped, 1 << min, maxAlloc,
         maxAlloc * 8, maxAlloc * 24, 0, tmpDir, new DummyMemoryManager(),
-        LlapDaemonCacheMetrics.create("test", "1"), null, true);
+        LlapDaemonCacheMetrics.create("test", "1"), "both", true);
     ExecutorService executor = Executors.newFixedThreadPool(3);
     final CountDownLatch cdlIn = new CountDownLatch(3), cdlOut = new CountDownLatch(1);
     FutureTask<Void> upTask = new FutureTask<Void>(new Callable<Void>() {
@@ -141,12 +142,29 @@ public class TestBuddyAllocator {
     executor.execute(downTask);
     try {
       cdlIn.await(); // Wait for all threads to be ready.
-      cdlOut.countDown(); // Release them at the same time.
+      cdlOut.countDown(); // Release them at the same time.\
+    } catch (Throwable t) {
+      LOG.error("failed on starting the thread race", t);
+      throw new RuntimeException(t);
+    }
+
+    try {
       upTask.get();
+    } catch (ExecutionException | InterruptedException e) {
+      LOG.error("failed on up task", e);
+      throw new RuntimeException(e);
+    }
+    try {
       downTask.get();
+    } catch (ExecutionException | InterruptedException e) {
+      LOG.error("failed on downTask", e);
+      throw new RuntimeException(e);
+    }
+    try {
       sameTask.get();
-    } catch (Throwable t) {
-      throw new RuntimeException(t);
+    } catch (ExecutionException | InterruptedException e) {
+      LOG.error("failed on sameTask", e);
+      throw new RuntimeException(e);
     }
   }