This is an automated email from the ASF dual-hosted git repository.
jxue pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/helix.git
The following commit(s) were added to refs/heads/master by this push:
new df597083d Fix unstable test testDisconnectWhenConnectionBreak (#2857)
df597083d is described below
commit df597083de576a70892e7c080ffc6ceeab4c77f7
Author: Junkai Xue <[email protected]>
AuthorDate: Wed Jul 31 10:36:55 2024 -0700
Fix unstable test testDisconnectWhenConnectionBreak (#2857)
Make the thread force interrupted and check the state of thread be
terminated then
start the zk.
---
.../test/java/org/apache/helix/integration/TestZkConnectionLost.java | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git
a/helix-core/src/test/java/org/apache/helix/integration/TestZkConnectionLost.java
b/helix-core/src/test/java/org/apache/helix/integration/TestZkConnectionLost.java
index d31a69c17..eb1f7b5f6 100644
---
a/helix-core/src/test/java/org/apache/helix/integration/TestZkConnectionLost.java
+++
b/helix-core/src/test/java/org/apache/helix/integration/TestZkConnectionLost.java
@@ -136,7 +136,9 @@ public class TestZkConnectionLost extends TaskTestBase {
Assert.assertTrue(disconnected.get());
Assert.assertFalse(controllerManager.isConnected());
} finally {
- testThread.interrupt();
+ testThread.stop();
+ TestHelper.verify(() ->
testThread.getState().equals(Thread.State.TERMINATED),
+ TestHelper.WAIT_DURATION);
_zkServerRef.set(TestHelper.startZkServer(_zkAddr, null, false));
}
}