[5/5] hadoop git commit: HDFS-10641. TestBlockManager#testBlockReportQueueing fails intermittently. (Contributed by Daryn Sharp)

2016-08-15 Thread liuml07
HDFS-10641. TestBlockManager#testBlockReportQueueing fails intermittently. 
(Contributed by Daryn Sharp)


Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/2f4660ce
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/2f4660ce
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/2f4660ce

Branch: refs/heads/branch-2
Commit: 2f4660ce9892e822d241c87954219460e4351779
Parents: 23161c6
Author: Mingliang Liu 
Authored: Mon Aug 15 20:28:40 2016 -0700
Committer: Mingliang Liu 
Committed: Mon Aug 15 20:39:12 2016 -0700

--
 .../hadoop/hdfs/server/blockmanagement/TestBlockManager.java | 8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hadoop/blob/2f4660ce/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/blockmanagement/TestBlockManager.java
--
diff --git 
a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/blockmanagement/TestBlockManager.java
 
b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/blockmanagement/TestBlockManager.java
index 5d0ca96..cc0fafd 100644
--- 
a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/blockmanagement/TestBlockManager.java
+++ 
b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/blockmanagement/TestBlockManager.java
@@ -945,6 +945,7 @@ public class TestBlockManager {
 
   final CyclicBarrier startBarrier = new CyclicBarrier(2);
   final CountDownLatch endLatch = new CountDownLatch(3);
+  final CountDownLatch doneLatch = new CountDownLatch(1);
 
   // create a task intended to block while processing, thus causing
   // the queue to backup.  simulates how a full BR is processed.
@@ -952,7 +953,7 @@ public class TestBlockManager {
   new Callable(){
 @Override
 public Void call() throws IOException {
-  return bm.runBlockOp(new Callable() {
+  bm.runBlockOp(new Callable() {
 @Override
 public Void call()
 throws InterruptedException, BrokenBarrierException {
@@ -962,6 +963,9 @@ public class TestBlockManager {
   return null;
 }
   });
+  // signal that runBlockOp returned
+  doneLatch.countDown();
+  return null;
 }
   });
 
@@ -1006,7 +1010,7 @@ public class TestBlockManager {
   startBarrier.await(1, TimeUnit.SECONDS);
   assertTrue(endLatch.await(1, TimeUnit.SECONDS));
   assertEquals(0, bm.getBlockOpQueueLength());
-  assertTrue(blockingOp.isDone());
+  assertTrue(doneLatch.await(1, TimeUnit.SECONDS));
 } finally {
   cluster.shutdown();
 }


-
To unsubscribe, e-mail: common-commits-unsubscr...@hadoop.apache.org
For additional commands, e-mail: common-commits-h...@hadoop.apache.org



[5/5] hadoop git commit: HDFS-10641. TestBlockManager#testBlockReportQueueing fails intermittently. (Contributed by Daryn Sharp)

2016-08-15 Thread liuml07
HDFS-10641. TestBlockManager#testBlockReportQueueing fails intermittently. 
(Contributed by Daryn Sharp)


Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/54c97432
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/54c97432
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/54c97432

Branch: refs/heads/branch-2.8
Commit: 54c974326329b206a2544544a685a306facf99cf
Parents: 657064e
Author: Mingliang Liu 
Authored: Mon Aug 15 20:28:40 2016 -0700
Committer: Mingliang Liu 
Committed: Mon Aug 15 20:46:48 2016 -0700

--
 .../hadoop/hdfs/server/blockmanagement/TestBlockManager.java | 8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hadoop/blob/54c97432/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/blockmanagement/TestBlockManager.java
--
diff --git 
a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/blockmanagement/TestBlockManager.java
 
b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/blockmanagement/TestBlockManager.java
index f57324d..e9d4018 100644
--- 
a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/blockmanagement/TestBlockManager.java
+++ 
b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/blockmanagement/TestBlockManager.java
@@ -945,6 +945,7 @@ public class TestBlockManager {
 
   final CyclicBarrier startBarrier = new CyclicBarrier(2);
   final CountDownLatch endLatch = new CountDownLatch(3);
+  final CountDownLatch doneLatch = new CountDownLatch(1);
 
   // create a task intended to block while processing, thus causing
   // the queue to backup.  simulates how a full BR is processed.
@@ -952,7 +953,7 @@ public class TestBlockManager {
   new Callable(){
 @Override
 public Void call() throws IOException {
-  return bm.runBlockOp(new Callable() {
+  bm.runBlockOp(new Callable() {
 @Override
 public Void call()
 throws InterruptedException, BrokenBarrierException {
@@ -962,6 +963,9 @@ public class TestBlockManager {
   return null;
 }
   });
+  // signal that runBlockOp returned
+  doneLatch.countDown();
+  return null;
 }
   });
 
@@ -1006,7 +1010,7 @@ public class TestBlockManager {
   startBarrier.await(1, TimeUnit.SECONDS);
   assertTrue(endLatch.await(1, TimeUnit.SECONDS));
   assertEquals(0, bm.getBlockOpQueueLength());
-  assertTrue(blockingOp.isDone());
+  assertTrue(doneLatch.await(1, TimeUnit.SECONDS));
 } finally {
   cluster.shutdown();
 }


-
To unsubscribe, e-mail: common-commits-unsubscr...@hadoop.apache.org
For additional commands, e-mail: common-commits-h...@hadoop.apache.org