]> git.puffer.fish Git - matthieu/frr.git/commitdiff
topotests: justify code sleep
authorRafael Zalamena <rzalamena@opensourcerouting.org>
Tue, 5 Oct 2021 15:37:34 +0000 (12:37 -0300)
committerRafael Zalamena <rzalamena@opensourcerouting.org>
Tue, 5 Oct 2021 15:41:33 +0000 (12:41 -0300)
Document the `sleep` statement so people know that we are sleeping
because we are waiting for the BFD down notification. If we don't
sleep here it is possible that we get outdated `show` command results.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
tests/topotests/bfd_ospf_topo1/test_bfd_ospf_topo1.py

index 33245b64c8704616b88014a6e78971c26cc6b6d1..bef2c3f162bb35942655d33fb0d991f7925b40ed 100755 (executable)
@@ -195,8 +195,8 @@ def test_bfd_ospf_interface_failure_rt2_step3():
 
     # By default BFD provides a recovery time of 900ms plus jitter, so let's wait
     # initial 2 seconds to let the CI not suffer.
-    # TODO: add check for array size
-    sleep(2)
+    topotest.sleep(2, 'Wait for BFD down notification')
+
     router_compare_json_output(
         "rt1", "show ip route ospf json", "step3/show_ip_route_rt2_down.ref", 1, 0
     )
@@ -234,8 +234,7 @@ def test_bfd_ospf_interface_failure_rt3_step3():
 
     # By default BFD provides a recovery time of 900ms plus jitter, so let's wait
     # initial 2 seconds to let the CI not suffer.
-    # TODO: add check for array size
-    sleep(2)
+    topotest.sleep(2, 'Wait for BFD down notification')
     router_compare_json_output(
         "rt1", "show ip route ospf json", "step3/show_ip_route_rt3_down.ref", 1, 0
     )