]> git.puffer.fish Git - matthieu/frr.git/commitdiff
tests: pbr_topo1 sometimes fails under really heavy load
authorDonald Sharp <sharpd@nvidia.com>
Mon, 23 May 2022 12:16:56 +0000 (08:16 -0400)
committerDonald Sharp <sharpd@nvidia.com>
Mon, 23 May 2022 19:28:46 +0000 (15:28 -0400)
This test is sometimes failing under severe load.  Give some time
for the linux rule installation to actually be registered by the
system before declaring failure.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
tests/topotests/pbr_topo1/test_pbr_topo1.py

index 586d9217d24eac1708bfecd200be4f72620b3c53..8506a151359a39bab40625c9fa9dda18b52fb59f 100644 (file)
@@ -234,15 +234,23 @@ def test_rule_linux_installation():
 
     logger.info("Checking for installed PBR rules in OS")
 
+    def _get_router_rules(router, expected):
+        actual = topotest.ip_rules(router)
+
+        logger.info(actual)
+        return topotest.json_cmp(actual, expected)
+
     router_list = tgen.routers().values()
     for router in router_list:
         rules_file = "{}/{}/linux-rules.json".format(CWD, router.name)
 
-        actual = topotest.ip_rules(router)
         expected = json.loads(open(rules_file).read())
 
+        test_func = partial(_get_router_rules, router, expected)
+
+        _, result = topotest.run_and_expect(test_func, None, count=20, wait=1)
         assertmsg = "Router {} OS rules mismatch".format(router.name)
-        assert topotest.json_cmp(actual, expected) is None, assertmsg
+        assert result is None, assertmsg
 
 
 if __name__ == "__main__":