Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[test_mux] add sleep in test_NH #2648

Merged
merged 4 commits into from
Feb 6, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions tests/test_mux.py
Original file line number Diff line number Diff line change
Expand Up @@ -551,6 +551,7 @@ def create_and_test_NH_routes(self, appdb, asicdb, dvs, dvs_route, mac):
self.set_mux_state(appdb, "Ethernet0", "active")
self.add_neighbor(dvs, neigh_ip, mac)
self.add_neighbor(dvs, neigh_ipv6, mac)
time.sleep(1)
dvs.runcmd(
"vtysh -c \"configure terminal\" -c \"ip route " + nh_route +
" " + neigh_ip + "\""
Expand All @@ -572,6 +573,7 @@ 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)
time.sleep(1)
self.check_nexthop_in_asic_db(asicdb, rtkeys[0], True)
self.check_nexthop_in_asic_db(asicdb, rtkeys_ipv6[0], True)

Expand All @@ -582,6 +584,7 @@ def create_and_test_NH_routes(self, appdb, asicdb, dvs, dvs_route, mac):

self.add_neighbor(dvs, neigh_ip, mac)
self.add_neighbor(dvs, neigh_ipv6, mac)
time.sleep(1)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Ndancejic can we use a more robust synchronization approach here? Let's say waiting for added/removed entries in APP/ASIC DB?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated it so we wait for db entries instead of sleeping

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Ndancejic thanks! Looks like the polling interval is too small, so PR keeps failing. Can you please have a look?

self.check_nexthop_in_asic_db(asicdb, rtkeys[0])
self.check_nexthop_in_asic_db(asicdb, rtkeys_ipv6[0])
dvs.runcmd(
Expand Down