hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From xuc...@apache.org
Subject [hbase] branch master updated: HBASE-21952 Fix unit test: TestClientOperationInterrupt#testInterrupt50Percent
Date Fri, 01 Mar 2019 06:20:35 GMT
This is an automated email from the ASF dual-hosted git repository.

xucang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hbase.git


The following commit(s) were added to refs/heads/master by this push:
     new fd152c2  HBASE-21952 Fix unit test: TestClientOperationInterrupt#testInterrupt50Percent
fd152c2 is described below

commit fd152c265e4441053f449c0927cf7635e8d82755
Author: Xu cang <xucang@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 bc9b715..73ffc00 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
@@ -138,8 +138,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();
     }
 
@@ -156,9 +160,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){


Mime
View raw message