sonic-net / sonic-mgmt

Configuration management examples for SONiC
Other
188 stars 705 forks source link

[action] [PR:13837] increase wait time for verifying dynamic bgp neigh #14180

Closed mssonicbld closed 3 weeks ago

mssonicbld commented 3 weeks ago

Description of PR

We see that test_bgp_speaker_announce_routes and test_bgp_speaker_announce_routes_v6 in test_bgp_speaker.py are flaky wherein sometimes it takes more than 90s for BGP prefix exchange between the DUT and exabgp on PTF. The test asserts after 90s. This PR Increases the wait time before verifying accepted prefixes of the dynamic neighbors

Summary: Increased the wait time before verifying accepted prefixes of the dynamic neighbors

Type of change

Back port request

Approach

What is the motivation for this PR?

test_bgp_speaker_announce_routes often fails, because wait time is not enough to announce dynamic bgp neighbors.

How did you do it?

increased the wait time

How did you verify/test it?

Verified that the tests are passing consistently

NOK log excerpts:

06/05/2024 01:54:10 utilities.wait_until L0156 DEBUG | is_all_neighbors_learned is still False after 90 seconds, exit with False
06/05/2024 01:54:10 __init__.pytest_runtest_call L0040 ERROR | Traceback (most recent call last):
 File "/usr/local/lib/python3.8/dist-packages/_pytest/python.py", line 1788, in runtest
 self.ihook.pytest_pyfunc_call(pyfuncitem=self)
 File "/usr/local/lib/python3.8/dist-packages/pluggy/_hooks.py", line 501, in __call__
 return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
 File "/usr/local/lib/python3.8/dist-packages/pluggy/_manager.py", line 119, in _hookexec
 return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
 File "/usr/local/lib/python3.8/dist-packages/pluggy/_callers.py", line 138, in _multicall
 raise exception.with_traceback(exception.__traceback__)
 File "/usr/local/lib/python3.8/dist-packages/pluggy/_callers.py", line 102, in _multicall
 res = hook_impl.function(*args)
 File "/usr/local/lib/python3.8/dist-packages/_pytest/python.py", line 194, in pytest_pyfunc_call
 result = testfunction(**testargs)
 File "/var/src/sonic-mgmt_vms63-t0-8111-05_649d4810167b56701a640827/tests/bgp/test_bgp_speaker.py", line 373, in test_bgp_speaker_announce_routes_v6
 bgp_speaker_announce_routes_common(common_setup_teardown, tbinfo, duthost, ptfhost, ipv4, ipv6,
 File "/var/src/sonic-mgmt_vms63-t0-8111-05_649d4810167b56701a640827/tests/bgp/test_bgp_speaker.py", line 283, in bgp_speaker_announce_routes_common
 assert wait_until(90, 10, 0, is_all_neighbors_learned, duthost, speaker_ips), \
AssertionError: Not all dynamic neighbors were learned
…

UT:

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html ---------------------- generated xml file: /run_logs/ananshar/bgp/test_bgp_speaker_2024-06-27-05-45-16.xml ----------------------- INFO:root:Can not get Allure report URL. Please check logs ----------------------------------------------------- live log sessionfinish ----------------------------------------------------- 05:48:59 init.pytest_terminal_summary L0067 INFO | Can not get Allure report URL. Please check logs ============================================ 3 passed, 1 warning in 221.82s (0:03:41) ============================================



#### Any platform specific information?
NA
#### Supported testbed topology if it's a new test case?
NA
### Documentation
NA
mssonicbld commented 3 weeks ago

Original PR: https://github.com/sonic-net/sonic-mgmt/pull/13837

mssonicbld commented 3 weeks ago

/azp run Azure.sonic-mgmt

azure-pipelines[bot] commented 3 weeks ago
Azure Pipelines successfully started running 1 pipeline(s).