gemmellr commented on code in PR #4710:
URL: https://github.com/apache/activemq-artemis/pull/4710#discussion_r1464715255
##########
tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/controlpackets/PublishTests.java:
##########
@@ -311,15 +312,15 @@ public void testRetainFlagFalse() throws Exception {
// send retained message
producer.publish(TOPIC, RETAINED_PAYLOAD.getBytes(), 2, true);
- Wait.assertTrue(() ->
server.locateQueue(MQTTUtil.convertMqttTopicFilterToCore(MQTTUtil.MQTT_RETAIN_ADDRESS_PREFIX,
TOPIC, MQTTUtil.MQTT_WILDCARD)).getMessageCount() == 1, 1000, 100);
+ Wait.assertTrue(() -> getRetainedMessageQueue(TOPIC).getMessageCount()
== 1, 1000, 100);
// send an unretained message; should *not* remove the existing retained
message
producer.publish(TOPIC, UNRETAINED_PAYLOAD.getBytes(), 2, false);
producer.disconnect();
producer.close();
- Wait.assertFalse(() ->
server.locateQueue(MQTTUtil.convertMqttTopicFilterToCore(MQTTUtil.MQTT_RETAIN_ADDRESS_PREFIX,
TOPIC, MQTTUtil.MQTT_WILDCARD)).getMessageCount() > 1, 1000, 100);
+ Wait.assertFalse(() -> getRetainedMessageQueue(TOPIC).getMessageCount()
> 1, 1000, 100);
Review Comment:
Makes sense. I think maybe I misread that when I commented, not sure I
saw/considered the wait. I'd generally try to avoid burning 1 second like that
by doing something else instead thats likely to be more timely but gives the
same 'processing should have occurred' result , e.g publishing another message
somewhere else after the one currently being sent here, and waiting for it to
arrive (after processing of the earlier message completes) before then checking
on the retained message queue. Its only a second, yes, but it quickly adds
up...there are ~20,000 tests after all.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]