Skip to content

Commit

Permalink
fix the issue which timeout is too short for bgp shut #7543
Browse files Browse the repository at this point in the history
What is the motivation for this PR?
flaky failure for platform test on 2700 platforms

How did you do it?
2 changes:

To extend the timeout from 30 seconds to 60, and increase the delay from 0 to 5 seconds.
To add some debug log
How did you verify/test it?
Run local test.
  • Loading branch information
StormLiangMS authored and wangxin committed Feb 27, 2023
1 parent b2993ab commit 7fcedb7
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions tests/common/fixtures/duthost_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,9 +191,13 @@ def check_ebgp_routes(num_v4_routes, num_v6_routes, duthost):
MAX_DIFF = 5
sumv4, sumv6 = duthost.get_ip_route_summary()
rtn_val = True
if 'ebgp' in sumv4 and 'routes' in sumv4['ebgp'] and abs(int(float(sumv4['ebgp']['routes'])) - int(float(num_v4_routes))) >= MAX_DIFF:
if 'ebgp' in sumv4 and 'routes' in sumv4['ebgp'] and \
abs(int(float(sumv4['ebgp']['routes'])) - int(float(num_v4_routes))) >= MAX_DIFF:
logger.info("IPv4 ebgp routes: {}".format(float(sumv4['ebgp']['routes'])))
rtn_val = False
if 'ebgp' in sumv6 and 'routes' in sumv6['ebgp'] and abs(int(float(sumv6['ebgp']['routes'])) - int(float(num_v6_routes))) >= MAX_DIFF:
if 'ebgp' in sumv6 and 'routes' in sumv6['ebgp'] and \
abs(int(float(sumv6['ebgp']['routes'])) - int(float(num_v6_routes))) >= MAX_DIFF:
logger.info("IPv6 ebgp routes: {}".format(float(sumv6['ebgp']['routes'])))
rtn_val = False
return rtn_val

Expand All @@ -216,7 +220,7 @@ def shutdown_ebgp(duthosts, rand_one_dut_hostname):
# Shutdown all eBGP neighbors
duthost.command("sudo config bgp shutdown all")
# Verify that the total eBGP routes are 0.
pytest_assert(wait_until(30, 2, 0, check_ebgp_routes, 0, 0, duthost),
pytest_assert(wait_until(60, 2, 5, check_ebgp_routes, 0, 0, duthost),
"eBGP routes are not 0 after shutting down all neighbors on {}".format(duthost))
pytest_assert(wait_until(orch_cpu_timeout, 2, 0, check_orch_cpu_utilization, duthost, orch_cpu_threshold),
"Orch CPU utilization {} > orch cpu threshold {} after shutdown all eBGP"
Expand Down

0 comments on commit 7fcedb7

Please sign in to comment.