mirror of https://github.com/apache/activemq.git
https://issues.apache.org/jira/browse/AMQ-5734 - fix intermittent failure - seems the retained empty message gets dispatched so we need to consume it or it may have been dispatched to the client, causing a later failure
This commit is contained in:
parent
9ef4259297
commit
f5283a9045
|
@ -167,6 +167,13 @@ public class MQTTAuthTest extends MQTTAuthTestSupport {
|
||||||
//delete retained message
|
//delete retained message
|
||||||
connection.publish(ANONYMOUS, "".getBytes(), QoS.AT_MOST_ONCE, true);
|
connection.publish(ANONYMOUS, "".getBytes(), QoS.AT_MOST_ONCE, true);
|
||||||
|
|
||||||
|
// that delete retained message gets dispatched! Wonder if that is expected?
|
||||||
|
// guess it is simpler if it is - it shows up on the assertNull:196 below on occasion
|
||||||
|
msg = connection.receive(1000, TimeUnit.MILLISECONDS);
|
||||||
|
assertNotNull(msg);
|
||||||
|
assertEquals(ANONYMOUS, new String(msg.getTopic()));
|
||||||
|
msg.ack();
|
||||||
|
|
||||||
connection.disconnect();
|
connection.disconnect();
|
||||||
|
|
||||||
// Test 3.1 functionality
|
// Test 3.1 functionality
|
||||||
|
@ -185,6 +192,7 @@ public class MQTTAuthTest extends MQTTAuthTestSupport {
|
||||||
connectionPub.publish(NAMED, NAMED.getBytes(), QoS.AT_MOST_ONCE, true);
|
connectionPub.publish(NAMED, NAMED.getBytes(), QoS.AT_MOST_ONCE, true);
|
||||||
|
|
||||||
msg = connection.receive(1000, TimeUnit.MILLISECONDS);
|
msg = connection.receive(1000, TimeUnit.MILLISECONDS);
|
||||||
|
LOG.info("got msg: " + msg + ", " + (msg != null ? new String(msg.getTopic()) : ""));
|
||||||
assertNull(msg);
|
assertNull(msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue