[Piglit] [PATCH 2/2] framework/log: Add new test to running in start not constructor

Dylan Baker dylan at pnwbakers.com
Fri Sep 30 19:57:36 UTC 2016


Otherwise there will be a spinner in the final call to summary that's
printed when piglit finishes.

Signed-off-by: Dylan Baker <dylanx.c.baker at intel.com>
---
 framework/log.py | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/framework/log.py b/framework/log.py
index 213b04f..083c0ac 100644
--- a/framework/log.py
+++ b/framework/log.py
@@ -122,10 +122,12 @@ class QuietLog(BaseLog):
             self._endcode = '\n'
 
         self.__counter = next(self._test_counter)
-        self._state['running'].append(self.__counter)
 
     def start(self, name):
-        pass
+        # This cannot be done in the constructor, since the constructor gets
+        # called for the final summary too.
+        with self._LOCK:
+            self._state['running'].append(self.__counter)
 
     def _log(self, status):
         """ non-locked helper for logging
-- 
2.10.0



More information about the Piglit mailing list