Skip to content

Commit b95f2fd

Browse files
committed
EMB-5436: fix timeout value while waiting for a ICMP package
1 parent 5365fcd commit b95f2fd

1 file changed

Lines changed: 12 additions & 3 deletions

File tree

tests/integration/suites/default/firmware_update.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3502,6 +3502,8 @@ class FirmwareDownloadSameSocketResumptionDownloadAbortInduceByOtherOperation(
35023502
test_suite.PcapEnabledTest,
35033503
FirmwareUpdate.CoapDownloaderRetryMixIn,
35043504
SameSocketDownload.Test):
3505+
ACK_TIMEOUT = 1.5
3506+
35053507
def setUp(self):
35063508
super().setUp(extra_cmdline_args=['--max-retransmit', '1'])
35073509

@@ -3535,8 +3537,9 @@ def runTest(self):
35353537
self.serv.close()
35363538
self.communicate('send-update')
35373539

3538-
# Wait for ICMP port unreachable.
3539-
self.wait_until_icmp_unreachable_count(1, timeout_s=10)
3540+
# Wait for ICMP port unreachable. One second timeout is enought as we
3541+
# should get the ICMP response right after we try to send a update.
3542+
self.wait_until_icmp_unreachable_count(1, timeout_s=1)
35403543

35413544
time.sleep(self.coap_downloader_retry_delay * 2)
35423545
# Ensure that no more retransmissions occurred.
@@ -3555,6 +3558,8 @@ class FirmwareDownloadSameSocketResumptionCloseSocket(
35553558
test_suite.PcapEnabledTest,
35563559
FirmwareUpdate.CoapDownloaderRetryMixIn,
35573560
SameSocketDownload.Test):
3561+
ACK_TIMEOUT = 1.5
3562+
35583563
def setUp(self):
35593564
super().setUp(extra_cmdline_args=['--max-retransmit', '1'])
35603565

@@ -3575,7 +3580,11 @@ def runTest(self):
35753580
self.serv.close()
35763581

35773582
# Wait for ICMP port unreachable.
3578-
self.wait_until_icmp_unreachable_count(1, timeout_s=10)
3583+
# Anjay will send a message to the server after ACK_TIMEOUT has passed
3584+
# so we add +1 sec. to prevent race conditions. After Anjay sends
3585+
# the re-transmission it will recieve a ICMP response because the server
3586+
# already closed.
3587+
self.wait_until_icmp_unreachable_count(1, timeout_s=(self.ACK_TIMEOUT + 1))
35793588

35803589
time.sleep(self.coap_downloader_retry_delay * 2)
35813590
# Ensure that no more retransmissions occurred.

0 commit comments

Comments
 (0)