make test: improve console output messages
[vpp.git] / test / framework.py
index 91915fc..fd493db 100644 (file)
@@ -9,6 +9,7 @@ import unittest
 import tempfile
 import time
 import resource
+import faulthandler
 from collections import deque
 from threading import Thread, Event
 from inspect import getdoc
@@ -653,9 +654,9 @@ class VppTestCase(unittest.TestCase):
         time.sleep(timeout)
         after = time.time()
         if after - before > 2 * timeout:
-            cls.logger.error(
-                    "time.sleep() derp! slept for %ss instead of ~%ss!" % (
-                        after - before, timeout))
+            cls.logger.error("unexpected time.sleep() result - "
+                             "slept for %ss instead of ~%ss!" % (
+                                 after - before, timeout))
         if hasattr(cls, 'logger'):
             cls.logger.debug(
                 "Finished sleep (%s) - slept %ss (wanted %ss)" % (
@@ -940,7 +941,7 @@ class VppTestRunner(unittest.TextTestRunner):
         :param test:
 
         """
-        gc.disable()  # disable garbage collection, we'll do that manually
+        faulthandler.enable()  # emit stack trace to stderr if killed by signal
         print("Running tests using custom test runner")  # debug message
         filter_file, filter_class, filter_func = self.parse_test_option()
         print("Active filters: file=%s, class=%s, function=%s" % (