hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From e...@apache.org
Subject git commit: HBASE-11445 TestZKProcedure#testMultiCohortWithMemberTimeoutDuringPrepare is flaky (Jeffrey Zhong)
Date Tue, 09 Sep 2014 03:59:33 GMT
Repository: hbase
Updated Branches:
  refs/heads/branch-1 c70da8b27 -> f509f61a4


HBASE-11445 TestZKProcedure#testMultiCohortWithMemberTimeoutDuringPrepare is flaky (Jeffrey
Zhong)


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

Branch: refs/heads/branch-1
Commit: f509f61a40952cd2185b8c35bdac32ca7d67b7d6
Parents: c70da8b
Author: Enis Soztutar <enis@apache.org>
Authored: Mon Sep 8 20:57:55 2014 -0700
Committer: Enis Soztutar <enis@apache.org>
Committed: Mon Sep 8 20:58:50 2014 -0700

----------------------------------------------------------------------
 .../org/apache/hadoop/hbase/procedure/TestZKProcedure.java     | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/f509f61a/hbase-server/src/test/java/org/apache/hadoop/hbase/procedure/TestZKProcedure.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/procedure/TestZKProcedure.java
b/hbase-server/src/test/java/org/apache/hadoop/hbase/procedure/TestZKProcedure.java
index 2c13181..b55a6ea 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/procedure/TestZKProcedure.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/procedure/TestZKProcedure.java
@@ -266,17 +266,15 @@ public class TestZKProcedure {
     }
 
     // pass out a task per member
-    final int[] i = new int[] { 0 };
+    final AtomicInteger taskIndex = new AtomicInteger();
     Mockito.when(
       subprocFactory.buildSubprocedure(Mockito.eq(opName),
         (byte[]) Mockito.argThat(new ArrayEquals(data)))).thenAnswer(
       new Answer<Subprocedure>() {
         @Override
         public Subprocedure answer(InvocationOnMock invocation) throws Throwable {
-          int index = i[0];
+          int index = taskIndex.getAndIncrement();
           Subprocedure commit = cohortTasks.get(index);
-          index++;
-          i[0] = index;
           return commit;
         }
       });


Mime
View raw message