From dd4b2bb39491cb8fbfb5db8a4b9ffc3b80beba48 Mon Sep 17 00:00:00 2001 From: Paul Vinciguerra Date: Thu, 15 Nov 2018 08:13:03 -0800 Subject: [PATCH] VPP-1495: Fix intermittent stat sock test failures. Loosen polling loop while waiting for stats socket. ============================================================================== Classifier IP6 UDP proto Test Case ============================================================================== connect: No such file or directory ============================================================================== ERROR: setUpClass (test_ip4.TestIPLoadBalance) ------------------------------------------------------------------------------ Traceback (most recent call last): File "/vpp/test/framework.py", line 424, in setUpClass cls.statistics = VPPStats(socketname=cls.stats_sock) File "build/bdist.linux-x86_64/egg/vpp_papi/vpp_stats.py", line 120, in _init_ raise IOError() IOError Change-Id: I80523122f96eafc41b3ebbf27bee73f6c637d781 Signed-off-by: Paul Vinciguerra --- test/framework.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/test/framework.py b/test/framework.py index 3201e632348..06876a1799b 100644 --- a/test/framework.py +++ b/test/framework.py @@ -356,9 +356,15 @@ class VppTestCase(unittest.TestCase): @classmethod def wait_for_stats_socket(cls): deadline = time.time() + 3 - while time.time() < deadline or cls.debug_gdb or cls.debug_gdbserver: + ok = False + while time.time() < deadline or \ + cls.debug_gdb or cls.debug_gdbserver: if os.path.exists(cls.stats_sock): + ok = True break + time.sleep(0.8) + if not ok: + cls.logger.critical("Couldn't stat : {}".format(cls.stats_sock)) @classmethod def setUpClass(cls): -- 2.16.6