From 6bd58beac507e1bb288dffe4ec0adb11d7e57a69 Mon Sep 17 00:00:00 2001 From: Angus Gratton Date: Fri, 3 Aug 2018 16:55:50 +1000 Subject: [PATCH 1/2] tiny-test-fw: Increase default expect timeout to 10 seconds Fix CI failures due to (for example) DHCP lease taking more than 5s to be negotiated. --- tools/tiny-test-fw/DUT.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/tiny-test-fw/DUT.py b/tools/tiny-test-fw/DUT.py index 0193cb6c70..091a961549 100644 --- a/tools/tiny-test-fw/DUT.py +++ b/tools/tiny-test-fw/DUT.py @@ -259,7 +259,7 @@ class BaseDUT(object): :param kwargs: extra args for DUT to create ports """ - DEFAULT_EXPECT_TIMEOUT = 5 + DEFAULT_EXPECT_TIMEOUT = 10 MAX_EXPECT_FAILURES_TO_SAVED = 10 LOG_THREAD = _LogThread() From 8b35d8ef2576362fb1400ff9f04e009c5baa9a4d Mon Sep 17 00:00:00 2001 From: Angus Gratton Date: Fri, 3 Aug 2018 16:59:23 +1000 Subject: [PATCH 2/2] asio example tests: Increase timeout for DHCP lease to 30s Covers time to connect to WiFi and negotiate lease, may be more than 5-10s on some busy APs --- examples/protocols/asio/chat_client/asio_chat_client_test.py | 2 +- examples/protocols/asio/chat_server/asio_chat_server_test.py | 2 +- examples/protocols/asio/tcp_echo_server/asio_tcp_server_test.py | 2 +- examples/protocols/asio/udp_echo_server/asio_udp_server_test.py | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/protocols/asio/chat_client/asio_chat_client_test.py b/examples/protocols/asio/chat_client/asio_chat_client_test.py index a1cce97c5a..5d6af28eef 100644 --- a/examples/protocols/asio/chat_client/asio_chat_client_test.py +++ b/examples/protocols/asio/chat_client/asio_chat_client_test.py @@ -75,7 +75,7 @@ def test_examples_protocol_asio_chat_client(env, extra_data): thread1.start() # 2. start the dut test and wait till client gets IP address dut1.start_app() - data = dut1.expect(re.compile(r" sta ip: ([^,]+),")) + data = dut1.expect(re.compile(r" sta ip: ([^,]+),"), timeout=30) # 3. send host's IP to the client i.e. the `dut1` dut1.write(host_ip) # 4. client `dut1` should receive a message diff --git a/examples/protocols/asio/chat_server/asio_chat_server_test.py b/examples/protocols/asio/chat_server/asio_chat_server_test.py index 55746f1f97..b5eb71ff6f 100644 --- a/examples/protocols/asio/chat_server/asio_chat_server_test.py +++ b/examples/protocols/asio/chat_server/asio_chat_server_test.py @@ -37,7 +37,7 @@ def test_examples_protocol_asio_chat_server(env, extra_data): # 1. start test dut1.start_app() # 2. get the server IP address - data = dut1.expect(re.compile(r" sta ip: ([^,]+),")) + data = dut1.expect(re.compile(r" sta ip: ([^,]+),"), timeout=30) # 3. create tcp client and connect to server cli = socket(AF_INET,SOCK_STREAM) cli.connect((data[0],80)) diff --git a/examples/protocols/asio/tcp_echo_server/asio_tcp_server_test.py b/examples/protocols/asio/tcp_echo_server/asio_tcp_server_test.py index 1ab432e626..6dcffa3a5d 100644 --- a/examples/protocols/asio/tcp_echo_server/asio_tcp_server_test.py +++ b/examples/protocols/asio/tcp_echo_server/asio_tcp_server_test.py @@ -38,7 +38,7 @@ def test_examples_protocol_asio_tcp_server(env, extra_data): # 1. start test dut1.start_app() # 2. get the server IP address - data = dut1.expect(re.compile(r" sta ip: ([^,]+),")) + data = dut1.expect(re.compile(r" sta ip: ([^,]+),"), timeout=30) # 3. create tcp client and connect to server cli = socket(AF_INET,SOCK_STREAM) cli.connect((data[0],80)) diff --git a/examples/protocols/asio/udp_echo_server/asio_udp_server_test.py b/examples/protocols/asio/udp_echo_server/asio_udp_server_test.py index 490a8007a8..642c686ed8 100644 --- a/examples/protocols/asio/udp_echo_server/asio_udp_server_test.py +++ b/examples/protocols/asio/udp_echo_server/asio_udp_server_test.py @@ -38,7 +38,7 @@ def test_examples_protocol_asio_udp_server(env, extra_data): # 1. start test dut1.start_app() # 2. get the server IP address - data = dut1.expect(re.compile(r" sta ip: ([^,]+),")) + data = dut1.expect(re.compile(r" sta ip: ([^,]+),"), timeout=30) # 3. create tcp client and connect to server cli = socket(AF_INET, SOCK_DGRAM) cli.connect((data[0], 80))