From: Rafael Zalamena Date: Tue, 5 Oct 2021 15:36:43 +0000 (-0300) Subject: topotests: decrease result check frequency X-Git-Tag: base_8.2~371^2~1 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=8ff24fd29effe974d870309bfb7bc89f39de0024;p=matthieu%2Ffrr.git topotests: decrease result check frequency Call the `show` commands less often to reduce the CPU pressure. Also increase the wait time from 60 to 80 seconds to have spare room for failures (4 times more). This is the latest measure wait time: > INFO: topolog: 'router_json_cmp' succeeded after 20.08 seconds Signed-off-by: Rafael Zalamena --- diff --git a/tests/topotests/bfd_ospf_topo1/test_bfd_ospf_topo1.py b/tests/topotests/bfd_ospf_topo1/test_bfd_ospf_topo1.py index 09b8631740..33245b64c8 100755 --- a/tests/topotests/bfd_ospf_topo1/test_bfd_ospf_topo1.py +++ b/tests/topotests/bfd_ospf_topo1/test_bfd_ospf_topo1.py @@ -132,7 +132,7 @@ def print_cmd_result(rname, command): print(get_topogen().gears[rname].vtysh_cmd(command, isjson=False)) -def router_compare_json_output(rname, command, reference, count=120, wait=0.5): +def router_compare_json_output(rname, command, reference, count=40, wait=2): "Compare router JSON output" logger.info('Comparing router "%s" "%s" output', rname, command) @@ -141,7 +141,7 @@ def router_compare_json_output(rname, command, reference, count=120, wait=0.5): filename = "{}/{}/{}".format(CWD, rname, reference) expected = json.loads(open(filename).read()) - # Run test function until we get an result. Wait at most 60 seconds. + # Run test function until we get an result. Wait at most 80 seconds. test_func = partial(topotest.router_json_cmp, tgen.gears[rname], command, expected) _, diff = topotest.run_and_expect(test_func, None, count=count, wait=wait) assertmsg = '"{}" JSON output mismatches the expected result'.format(rname)