HBASE-7633 Fix flakey TestZKProcedure.testMultiCohortWithMemberTimeoutDuringPrepare

git-svn-id: https://svn.apache.org/repos/asf/hbase/branches/hbase-7290@1445868 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Jonathan Hsieh 2013-02-13 19:14:43 +00:00
parent 465ea7f99e
commit 51a50ea826
2 changed files with 8 additions and 2 deletions

View File

@ -334,7 +334,9 @@ public class Procedure implements Callable<Void>, ForeignExceptionListener {
}
/**
* Waits until the entire procedure has globally completed, or has been aborted.
* Waits until the entire procedure has globally completed, or has been aborted. If an
* exception is thrown the procedure may or not have run cleanup to trigger the completion latch
* yet.
* @throws ForeignException
* @throws InterruptedException
*/

View File

@ -21,6 +21,7 @@ import static org.junit.Assert.assertEquals;
import static org.mockito.Matchers.any;
import static org.mockito.Matchers.anyListOf;
import static org.mockito.Matchers.eq;
import static org.mockito.Mockito.atMost;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.spy;
import static org.mockito.Mockito.when;
@ -316,7 +317,10 @@ public class TestZKProcedure {
// -------------
// verification
// -------------
waitAndVerifyProc(coordinatorTask, once, never(), once, once, true);
// always expect prepared, never committed, and possible to have cleanup and finish (racy since
// error case)
waitAndVerifyProc(coordinatorTask, once, never(), once, atMost(1), true);
verifyCohortSuccessful(expected, subprocFactory, cohortTasks, once, never(), once,
once, true);