HBASE-21952 Fix unit test: TestClientOperationInterrupt#testInterrupt50Percent
This commit is contained in:
parent
e0be1958b7
commit
3c6ac6d3f8
|
@ -138,8 +138,12 @@ public class TestClientOperationInterrupt {
|
||||||
threads.add(t);
|
threads.add(t);
|
||||||
t.start();
|
t.start();
|
||||||
}
|
}
|
||||||
|
int expectedNoExNum = nbThread / 2;
|
||||||
|
|
||||||
for (int i = 0; i < nbThread / 2; i++) {
|
for (int i = 0; i < nbThread / 2; i++) {
|
||||||
|
if (threads.get(i).getState().equals(Thread.State.TERMINATED)) {
|
||||||
|
expectedNoExNum--;
|
||||||
|
}
|
||||||
threads.get(i).interrupt();
|
threads.get(i).interrupt();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -156,9 +160,8 @@ public class TestClientOperationInterrupt {
|
||||||
}
|
}
|
||||||
|
|
||||||
Assert.assertFalse(Thread.currentThread().isInterrupted());
|
Assert.assertFalse(Thread.currentThread().isInterrupted());
|
||||||
|
|
||||||
Assert.assertTrue(" noEx: " + noEx.get() + ", badEx=" + badEx.get() + ", noInt=" + noInt.get(),
|
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
|
// The problem here is that we need the server to free its handlers to handle all operations
|
||||||
while (done.get() != nbThread){
|
while (done.get() != nbThread){
|
||||||
|
|
Loading…
Reference in New Issue