[FIXED] Increased AckWait in TestMQTTQoS2RetriesPublish, TestMQTTQoS2RetriesPubRel (#4518)

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.
This commit is contained in:
Neil
2023-09-13 11:49:17 +01:00
committed by GitHub

View File

@@ -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)