tajo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jh...@apache.org
Subject git commit: TAJO-686: Integration test aborted. (jinho)
Date Fri, 14 Mar 2014 03:01:11 GMT
Repository: incubator-tajo
Updated Branches:
  refs/heads/branch-0.8.0 7a7009b39 -> 7d9d42c38


TAJO-686: Integration test aborted. (jinho)


Project: http://git-wip-us.apache.org/repos/asf/incubator-tajo/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tajo/commit/7d9d42c3
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tajo/tree/7d9d42c3
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tajo/diff/7d9d42c3

Branch: refs/heads/branch-0.8.0
Commit: 7d9d42c38e909f520307fbe6a5531a546e764428
Parents: 7a7009b
Author: jinossy <jinossy@gmail.com>
Authored: Fri Mar 14 12:00:14 2014 +0900
Committer: jinossy <jinossy@gmail.com>
Committed: Fri Mar 14 12:00:14 2014 +0900

----------------------------------------------------------------------
 CHANGES.txt                                     |  4 +++
 .../tajo/master/TestTajoResourceManager.java    | 33 +++++++-------------
 2 files changed, 16 insertions(+), 21 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tajo/blob/7d9d42c3/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index c6508f4..06c132f 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -581,6 +581,10 @@ Release 0.8.0 - unreleased
 
     TAJO-319: Update homepage and bump tajo version to 0.8. (hyunsik)
 
+  TEST
+
+    TAJO-686: Integration test aborted. (jinho)
+
 Release 0.2.0 - released
 
   NEW FEATURES

http://git-wip-us.apache.org/repos/asf/incubator-tajo/blob/7d9d42c3/tajo-core/tajo-core-backend/src/test/java/org/apache/tajo/master/TestTajoResourceManager.java
----------------------------------------------------------------------
diff --git a/tajo-core/tajo-core-backend/src/test/java/org/apache/tajo/master/TestTajoResourceManager.java
b/tajo-core/tajo-core-backend/src/test/java/org/apache/tajo/master/TestTajoResourceManager.java
index 9504927..bf294a8 100644
--- a/tajo-core/tajo-core-backend/src/test/java/org/apache/tajo/master/TestTajoResourceManager.java
+++ b/tajo-core/tajo-core-backend/src/test/java/org/apache/tajo/master/TestTajoResourceManager.java
@@ -32,6 +32,8 @@ import org.junit.Test;
 
 import java.util.ArrayList;
 import java.util.List;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.TimeUnit;
 
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertTrue;
@@ -139,7 +141,7 @@ public class TestTajoResourceManager {
         .setMaxMemoryMBPerContainer(maxMemory)
         .build();
 
-    final Object monitor = new Object();
+    final CountDownLatch barrier = new CountDownLatch(1);
     final List<YarnProtos.ContainerIdProto> containerIds = new ArrayList<YarnProtos.ContainerIdProto>();
 
 
@@ -148,16 +150,12 @@ public class TestTajoResourceManager {
       @Override
       public void run(WorkerResourceAllocationResponse response) {
         TestTajoResourceManager.this.response = response;
-        synchronized(monitor) {
-          monitor.notifyAll();
-        }
+        barrier.countDown();
       }
     };
 
     tajoWorkerResourceManager.allocateWorkerResources(request, callBack);
-    synchronized(monitor) {
-      monitor.wait();
-    }
+    assertTrue(barrier.await(3, TimeUnit.SECONDS));
 
 
     // assert after callback
@@ -225,22 +223,18 @@ public class TestTajoResourceManager {
           .setMaxMemoryMBPerContainer(maxMemory)
           .build();
 
-      final Object monitor = new Object();
+      final CountDownLatch barrier = new CountDownLatch(1);
 
       RpcCallback<WorkerResourceAllocationResponse> callBack = new RpcCallback<WorkerResourceAllocationResponse>()
{
         @Override
         public void run(WorkerResourceAllocationResponse response) {
           TestTajoResourceManager.this.response = response;
-          synchronized(monitor) {
-            monitor.notifyAll();
-          }
+          barrier.countDown();
         }
       };
 
       tajoWorkerResourceManager.allocateWorkerResources(request, callBack);
-      synchronized(monitor) {
-        monitor.wait();
-      }
+      assertTrue(barrier.await(3, TimeUnit.SECONDS));
 
       numAllocatedContainers += TestTajoResourceManager.this.response.getWorkerAllocatedResourceList().size();
 
@@ -298,7 +292,7 @@ public class TestTajoResourceManager {
         .setMaxMemoryMBPerContainer(memoryMB)
         .build();
 
-    final Object monitor = new Object();
+    final CountDownLatch barrier = new CountDownLatch(1);
     final List<YarnProtos.ContainerIdProto> containerIds = new ArrayList<YarnProtos.ContainerIdProto>();
 
 
@@ -307,16 +301,13 @@ public class TestTajoResourceManager {
       @Override
       public void run(WorkerResourceAllocationResponse response) {
         TestTajoResourceManager.this.response = response;
-        synchronized(monitor) {
-          monitor.notifyAll();
-        }
+        barrier.countDown();
       }
     };
 
     tajoWorkerResourceManager.allocateWorkerResources(request, callBack);
-    synchronized(monitor) {
-      monitor.wait();
-    }
+    assertTrue(barrier.await(3, TimeUnit.SECONDS));
+
     for(WorkerAllocatedResource eachResource: response.getWorkerAllocatedResourceList())
{
       assertTrue("AllocatedDiskSlot:" + eachResource.getAllocatedDiskSlots(),
           eachResource.getAllocatedDiskSlots() >= minDiskSlots &&


Mime
View raw message