You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by xu...@apache.org on 2019/03/01 06:18:58 UTC
[hbase] branch branch-1 updated: HBASE-21952 Fix unit test:
TestClientOperationInterrupt#testInterrupt50Percent
This is an automated email from the ASF dual-hosted git repository.
xucang pushed a commit to branch branch-1
in repository https://gitbox.apache.org/repos/asf/hbase.git
The following commit(s) were added to refs/heads/branch-1 by this push:
new 3b1e56e HBASE-21952 Fix unit test: TestClientOperationInterrupt#testInterrupt50Percent
3b1e56e is described below
commit 3b1e56ec36c043d0d9e294b227d6340c99244207
Author: Xu cang <xu...@apache.org>
AuthorDate: Wed Feb 27 13:19:13 2019 -0800
HBASE-21952 Fix unit test: TestClientOperationInterrupt#testInterrupt50Percent
---
.../apache/hadoop/hbase/client/TestClientOperationInterrupt.java | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestClientOperationInterrupt.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestClientOperationInterrupt.java
index 72b74fb..39f7c92 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestClientOperationInterrupt.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestClientOperationInterrupt.java
@@ -127,8 +127,12 @@ public class TestClientOperationInterrupt {
threads.add(t);
t.start();
}
+ int expectedNoExNum = nbThread / 2;
for (int i = 0; i < nbThread / 2; i++) {
+ if (threads.get(i).getState().equals(Thread.State.TERMINATED)) {
+ expectedNoExNum--;
+ }
threads.get(i).interrupt();
}
@@ -145,9 +149,8 @@ public class TestClientOperationInterrupt {
}
Assert.assertFalse(Thread.currentThread().isInterrupted());
-
Assert.assertTrue(" noEx: " + noEx.get() + ", badEx=" + badEx.get() + ", noInt=" + noInt.get(),
- noEx.get() == nbThread / 2 && badEx.get() == 0);
+ noEx.get() == expectedNoExNum && badEx.get() == 0);
// The problem here is that we need the server to free its handlers to handle all operations
while (done.get() != nbThread){