From a0b79b5b3fa16b381129e80a3960aaf7c6eda8db Mon Sep 17 00:00:00 2001 From: Albrecht Lohofener Date: Tue, 3 Dec 2024 14:30:45 +0100 Subject: [PATCH] Make test_openwrt_wan more robust --- test/tests/openwrt_docker_test.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test/tests/openwrt_docker_test.py b/test/tests/openwrt_docker_test.py index 1a9734b..8a576ec 100644 --- a/test/tests/openwrt_docker_test.py +++ b/test/tests/openwrt_docker_test.py @@ -306,8 +306,10 @@ def test_openwrt_wan(docker_services, parameter): match parameter[1]: case '' | 'host': # For some reason ping is not working at github actions, so use nslookup to test internet connection - response = run_openwrt_shell_command("nslookup", "google.com") - assert response['exitcode'] == 0 + try: + polling2.poll(lambda: run_openwrt_shell_command("nslookup", "google.com")['exitcode'] == 0, step=1, timeout=240) + except polling2.TimeoutException: + assert True, 'nslookup timeout' return case 'none':