This is an automated email from the ASF dual-hosted git repository.
clebertsuconic pushed a commit to branch 2.x
in repository https://gitbox.apache.org/repos/asf/activemq-artemis.git
The following commit(s) were added to refs/heads/2.x by this push:
new 739215f567 NO-JIRA Trying to fix StompV11Test intermittent failure
739215f567 is described below
commit 739215f567a6b0d6729e5a2b2fab436370cea8c3
Author: Clebert Suconic <[email protected]>
AuthorDate: Tue Sep 13 23:05:09 2022 -0400
NO-JIRA Trying to fix StompV11Test intermittent failure
(cherry picked from commit 59585ffc949ed567c5e8ae91ea068f882bd178b1)
---
.../tests/integration/stomp/v11/StompV11Test.java | 18 ++++++------------
1 file changed, 6 insertions(+), 12 deletions(-)
diff --git
a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/v11/StompV11Test.java
b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/v11/StompV11Test.java
index 2e6392bae7..0535027356 100644
---
a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/v11/StompV11Test.java
+++
b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/v11/StompV11Test.java
@@ -2188,6 +2188,7 @@ public class StompV11Test extends StompTestBase {
public void testHeartBeat3() throws Exception {
connection.close();
+ Assert.assertEquals(0,
server.getRemotingService().getConnections().size());
ClientStompFrame frame = conn.createFrame("CONNECT");
frame.addHeader("host", "127.0.0.1");
frame.addHeader("login", this.defUser);
@@ -2217,12 +2218,10 @@ public class StompV11Test extends StompTestBase {
int size = conn.getServerPingNumber();
conn.stopPinger();
- //((AbstractStompClientConnection)conn).killReaderThread();
- Wait.waitFor(() -> {
- return server.getRemotingService().getConnections().size() == 0;
- });
- Wait.assertFalse(stompFrameHandler.getHeartBeater()::isStarted);
+ Wait.assertEquals(0, () ->
server.getRemotingService().getConnections().size());
+
+ Wait.assertFalse("HeartBeater is still running!!", () ->
stompFrameHandler.getHeartBeater().isStarted());
}
@Test
@@ -2274,14 +2273,9 @@ public class StompV11Test extends StompTestBase {
conn.stopPinger();
- // give it some time to detect and close connections
- Thread.sleep(2000);
-
- Wait.waitFor(() -> {
- return server.getRemotingService().getConnections().size() == 0;
- });
+ Wait.assertEquals(0, () ->
server.getRemotingService().getConnections().size());
- Wait.assertFalse("HeartBeater is still running!!",
stompFrameHandler.getHeartBeater()::isStarted);
+ Wait.assertFalse("HeartBeater is still running!!", () ->
stompFrameHandler.getHeartBeater().isStarted());
}