From b60df6ec2d7cdd7fb1d9ac9ad885822d1ed9bb87 Mon Sep 17 00:00:00 2001 From: Lev Brouk Date: Tue, 12 Sep 2023 10:21:16 -0700 Subject: [PATCH] Increased AckWait in TestMQTTQoS2RetriesXXX TestMQTTQoS2RetriesPublish to 100ms, and in TestMQTTQoS2RetriesPubRel to 50ms. A lesser value caused another PUBLISH to be fired while the test was still processing the final QoS2 flow. Reduced the number of retries we wait for to make the test a little quicker. --- server/mqtt_test.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/server/mqtt_test.go b/server/mqtt_test.go index 897b4e17..76bd223e 100644 --- a/server/mqtt_test.go +++ b/server/mqtt_test.go @@ -5055,7 +5055,7 @@ func TestMQTTQoS2RejectPublishDuplicates(t *testing.T) { func TestMQTTQoS2RetriesPublish(t *testing.T) { o := testMQTTDefaultOptions() - o.MQTT.AckWait = 10 * time.Millisecond + o.MQTT.AckWait = 100 * time.Millisecond s := testMQTTRunServer(t, o) defer testMQTTShutdownServer(s) @@ -5081,8 +5081,8 @@ func TestMQTTQoS2RetriesPublish(t *testing.T) { // yet. subPI := testMQTTCheckPubMsgNoAck(t, c, r, "foo", mqttPubQoS2, []byte("data1")) - // See that the message is redelivered again 3 times, with the DUP on, before we PUBREC it. - for i := 0; i < 3; i++ { + // See that the message is redelivered again 2 times, with the DUP on, before we PUBREC it. + for i := 0; i < 2; i++ { expectedFlags := mqttPubQoS2 | mqttPubFlagDup pi := testMQTTCheckPubMsgNoAck(t, c, r, "foo", expectedFlags, []byte("data1")) if pi != subPI { @@ -5099,7 +5099,7 @@ func TestMQTTQoS2RetriesPublish(t *testing.T) { func TestMQTTQoS2RetriesPubRel(t *testing.T) { o := testMQTTDefaultOptions() - o.MQTT.AckWait = 10 * time.Millisecond + o.MQTT.AckWait = 50 * time.Millisecond s := testMQTTRunServer(t, o) defer testMQTTShutdownServer(s)