diff options
author | Christian Breunig <christian@breunig.cc> | 2024-10-04 07:25:53 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-10-04 07:25:53 +0200 |
commit | a305ebba559a2c3283e6b72b40edbb92e76b9cec (patch) | |
tree | a2d3ae1800708a3f2bfad217466f97cc8831e089 | |
parent | 5b10912a00ef5621c84aed2129ba3daaa7f06b98 (diff) | |
parent | 23e4ab655e3ef428250763150ae0a6a69fa59859 (diff) | |
download | vyos-1x-a305ebba559a2c3283e6b72b40edbb92e76b9cec.tar.gz vyos-1x-a305ebba559a2c3283e6b72b40edbb92e76b9cec.zip |
Merge pull request #4125 from sever-sever/T6761
T6761: Add timeout for OSPF smoketest fail
-rwxr-xr-x | smoketest/scripts/cli/test_protocols_ospf.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/smoketest/scripts/cli/test_protocols_ospf.py b/smoketest/scripts/cli/test_protocols_ospf.py index 905eaf2e9..c3ae54e12 100755 --- a/smoketest/scripts/cli/test_protocols_ospf.py +++ b/smoketest/scripts/cli/test_protocols_ospf.py @@ -15,6 +15,7 @@ # along with this program. If not, see <http://www.gnu.org/licenses/>. import unittest +import time from base_vyostest_shim import VyOSUnitTestSHIM @@ -558,6 +559,22 @@ class TestProtocolsOSPF(VyOSUnitTestSHIM.TestCase): # Verify FRR ospfd configuration frrconfig = self.getFRRconfig('router ospf', daemon=PROCESS_NAME) + # Required to prevent the race condition T6761 + retry_count = 0 + max_retries = 60 + + while not frrconfig and retry_count < max_retries: + # Log every 10 seconds + if retry_count % 10 == 0: + print(f"Attempt {retry_count}: FRR config is still empty. Retrying...") + + retry_count += 1 + time.sleep(1) + frrconfig = self.getFRRconfig('router ospf', daemon=PROCESS_NAME) + + if not frrconfig: + print("Failed to retrieve FRR config after 60 seconds") + self.assertIn(f'router ospf', frrconfig) self.assertIn(f' network {network} area {area1}', frrconfig) |