Skip to content

Commit

Permalink
Fix route/test_route_consistency.py (#12512)
Browse files Browse the repository at this point in the history
What is the motivation for this PR?
After announcing the routes, it is taking some time for kernel routes (IP-in-IP tunnel routes from standby ToR to active ToR) to be populated in ASIC_DB. And current sleep_interval is not enough for kernel routes to be populated in some of the runs and thus test is failing because of mismatch in pre_test_route_snapshot and post_test_route_snapshot (lead to AssertionError.

How did you do it?
Increased the sleep_interval (to ~100 secs) for time.sleep after announcing the routes (announce or withdraw) to give more time for kernel routes to be populated in ASIC_DB.

How did you verify/test it?
Test is consistently passing with the fix (verified on Arista-7260CX3-C64).
  • Loading branch information
vkjammala-arista authored and mssonicbld committed May 30, 2024
1 parent 0386217 commit 5383397
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/route/test_route_consistency.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ def setup(self, duthosts):
# take the snapshot of route table from all the DUTs
self.__class__.pre_test_route_snapshot, max_prefix_cnt = self.get_route_prefix_snapshot_from_asicdb(duthosts)
"""sleep interval is calculated based on the max number of prefixes in the route table.
Addtional 60 seconds is added to the sleep interval to account for the time taken to
withdraw and advertise the routes by peers
Addtional 100 seconds is added to the sleep interval to account for the time taken to
withdraw and advertise the routes by peers.
"""
self.__class__.sleep_interval = math.ceil(max_prefix_cnt/3000) + 60
self.__class__.sleep_interval = math.ceil(max_prefix_cnt/3000) + 100
logger.debug("max_no_of_prefix: {} sleep_interval: {}".format(max_prefix_cnt, self.sleep_interval))

def test_route_withdraw_advertise(self, duthosts, tbinfo, localhost):
Expand Down

0 comments on commit 5383397

Please sign in to comment.