You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tajo.apache.org by jh...@apache.org on 2014/03/14 03:47:23 UTC
git commit: TAJO-686: Integration test aborted. (jinho)
Repository: incubator-tajo
Updated Branches:
refs/heads/master db5e954f4 -> bd063cd4d
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/bd063cd4
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tajo/tree/bd063cd4
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tajo/diff/bd063cd4
Branch: refs/heads/master
Commit: bd063cd4d37685674b2c08808ca6ae5402ab2230
Parents: db5e954
Author: jinossy <ji...@gmail.com>
Authored: Fri Mar 14 11:46:16 2014 +0900
Committer: jinossy <ji...@gmail.com>
Committed: Fri Mar 14 11:46:16 2014 +0900
----------------------------------------------------------------------
CHANGES.txt | 3 ++
.../tajo/master/rm/TestTajoResourceManager.java | 35 ++++++++------------
2 files changed, 16 insertions(+), 22 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-tajo/blob/bd063cd4/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 120569a..1e5f747 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -588,6 +588,9 @@ Release 0.8.0 - unreleased
TAJO-602: WorkerResourceManager should be broke down into 3 parts.
(hyunsik)
+ TEST
+
+ TAJO-686: Integration test aborted. (jinho)
Release 0.2.0 - released
http://git-wip-us.apache.org/repos/asf/incubator-tajo/blob/bd063cd4/tajo-core/tajo-core-backend/src/test/java/org/apache/tajo/master/rm/TestTajoResourceManager.java
----------------------------------------------------------------------
diff --git a/tajo-core/tajo-core-backend/src/test/java/org/apache/tajo/master/rm/TestTajoResourceManager.java b/tajo-core/tajo-core-backend/src/test/java/org/apache/tajo/master/rm/TestTajoResourceManager.java
index af48fa6..34deb29 100644
--- a/tajo-core/tajo-core-backend/src/test/java/org/apache/tajo/master/rm/TestTajoResourceManager.java
+++ b/tajo-core/tajo-core-backend/src/test/java/org/apache/tajo/master/rm/TestTajoResourceManager.java
@@ -30,6 +30,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.apache.tajo.ipc.TajoResourceTrackerProtocol.NodeHeartbeat;
import static org.junit.Assert.assertEquals;
@@ -148,25 +150,20 @@ 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>();
-
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));
// assert after callback
@@ -242,22 +239,19 @@ 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();
@@ -324,7 +318,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>();
@@ -333,16 +327,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 &&