VPP-1495: Fix intermittent stat sock test failures. 73/15973/4
authorPaul Vinciguerra <pvinci@vinciconsulting.com>
Thu, 15 Nov 2018 16:13:03 +0000 (08:13 -0800)
committerOle Trøan <otroan@employees.org>
Fri, 16 Nov 2018 07:27:22 +0000 (07:27 +0000)
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 <pvinci@vinciconsulting.com>
test/framework.py

index 3201e63..06876a1 100644 (file)
@@ -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):