hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From e...@apache.org
Subject [1/2] git commit: HBASE-11445 TestZKProcedure#testMultiCohortWithMemberTimeoutDuringPrepare is flaky (Jeffrey Zhong)
Date Tue, 09 Sep 2014 05:42:45 GMT
Repository: hbase
Updated Branches:
  refs/heads/0.98 605bc083c -> 2ed1f8f78


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/98594939
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/98594939
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/98594939

Branch: refs/heads/0.98
Commit: 985949399fd6a0b118acbe6606845fa9735d8068
Parents: 605bc08
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 21:00:02 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/98594939/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