From 02c226714a6a229156b42392307d3c44b268d271 Mon Sep 17 00:00:00 2001 From: Nikola Dancejic <26731235+Ndancejic@users.noreply.github.com> Date: Mon, 6 Feb 2023 10:11:11 -0800 Subject: [PATCH] [test_mux] add sleep in test_NH (#2648) * [test_mux] add sleep in test_NH What I did: added sleep after adding/removing neighbors in test_NH Why I did it: resolve PR failures due to timing issues between adding/deleting neighbors and them being present in the asic_db Signed-off-by: Nikola Dancejic --- tests/test_mux.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/tests/test_mux.py b/tests/test_mux.py index 9cb14997ca5d..8313980130ad 100644 --- a/tests/test_mux.py +++ b/tests/test_mux.py @@ -560,6 +560,8 @@ def create_and_test_NH_routes(self, appdb, asicdb, dvs, dvs_route, mac): " " + neigh_ipv6 + "\"" ) apdb.wait_for_entry("ROUTE_TABLE", nh_route) + apdb.wait_for_entry("ROUTE_TABLE", nh_route_ipv6) + rtkeys = dvs_route.check_asicdb_route_entries([nh_route]) rtkeys_ipv6 = dvs_route.check_asicdb_route_entries([nh_route_ipv6]) self.check_nexthop_in_asic_db(asicdb, rtkeys[0]) @@ -572,16 +574,22 @@ def create_and_test_NH_routes(self, appdb, asicdb, dvs, dvs_route, mac): self.del_neighbor(dvs, neigh_ip) self.del_neighbor(dvs, neigh_ipv6) + apdb.wait_for_deleted_entry(self.APP_NEIGH_TABLE, neigh_ip) + apdb.wait_for_deleted_entry(self.APP_NEIGH_TABLE, neigh_ipv6) + asicdb.wait_for_deleted_entry(self.ASIC_NEIGH_TABLE, neigh_ip) + asicdb.wait_for_deleted_entry(self.ASIC_NEIGH_TABLE, neigh_ip) + self.check_nexthop_in_asic_db(asicdb, rtkeys[0], True) self.check_nexthop_in_asic_db(asicdb, rtkeys_ipv6[0], True) # Set state to active, learn neighbor again self.set_mux_state(appdb, "Ethernet0", "active") - self.check_nexthop_in_asic_db(asicdb, rtkeys[0], True) - self.check_nexthop_in_asic_db(asicdb, rtkeys_ipv6[0], True) self.add_neighbor(dvs, neigh_ip, mac) self.add_neighbor(dvs, neigh_ipv6, mac) + self.check_neigh_in_asic_db(asicdb, neigh_ip) + self.check_neigh_in_asic_db(asicdb, neigh_ipv6) + self.check_nexthop_in_asic_db(asicdb, rtkeys[0]) self.check_nexthop_in_asic_db(asicdb, rtkeys_ipv6[0]) dvs.runcmd(