mirror of https://github.com/apache/activemq.git
add some logging to diagnose ci failure
This commit is contained in:
parent
18d05ba5e0
commit
2b3f0e5958
|
@ -1671,24 +1671,29 @@ public class MQTTTest extends MQTTTestSupport {
|
||||||
}
|
}
|
||||||
connectionSub.disconnect();
|
connectionSub.disconnect();
|
||||||
|
|
||||||
for (int j = 0; j < numberOfRuns; j++) {
|
try {
|
||||||
|
for (int j = 0; j < numberOfRuns; j++) {
|
||||||
|
|
||||||
for (int i = 0; i < messagesPerRun; ++i) {
|
for (int i = 0; i < messagesPerRun; ++i) {
|
||||||
connectionPub.publish(topics[0].name().toString(), payload, QoS.AT_LEAST_ONCE, false);
|
connectionPub.publish(topics[0].name().toString(), payload, QoS.AT_LEAST_ONCE, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
connectionSub = mqttSub.blockingConnection();
|
||||||
|
connectionSub.connect();
|
||||||
|
connectionSub.subscribe(topics);
|
||||||
|
|
||||||
|
for (int i = 0; i < messagesPerRun; ++i) {
|
||||||
|
Message message = connectionSub.receive(5, TimeUnit.SECONDS);
|
||||||
|
assertNotNull(message);
|
||||||
|
received++;
|
||||||
|
assertTrue(Arrays.equals(payload, message.getPayload()));
|
||||||
|
message.ack();
|
||||||
|
}
|
||||||
|
connectionSub.disconnect();
|
||||||
}
|
}
|
||||||
|
} catch (Exception exception) {
|
||||||
connectionSub = mqttSub.blockingConnection();
|
LOG.error("unexpected exception", exception);
|
||||||
connectionSub.connect();
|
exception.printStackTrace();
|
||||||
connectionSub.subscribe(topics);
|
|
||||||
|
|
||||||
for (int i = 0; i < messagesPerRun; ++i) {
|
|
||||||
Message message = connectionSub.receive(5, TimeUnit.SECONDS);
|
|
||||||
assertNotNull(message);
|
|
||||||
received++;
|
|
||||||
assertTrue(Arrays.equals(payload, message.getPayload()));
|
|
||||||
message.ack();
|
|
||||||
}
|
|
||||||
connectionSub.disconnect();
|
|
||||||
}
|
}
|
||||||
assertEquals("Should have received " + (messagesPerRun * (numberOfRuns + 1)) + " messages", (messagesPerRun * (numberOfRuns + 1)), received);
|
assertEquals("Should have received " + (messagesPerRun * (numberOfRuns + 1)) + " messages", (messagesPerRun * (numberOfRuns + 1)), received);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue