All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] lib/oe/utils: Improve multiprocess_lauch exception handling
@ 2018-12-05 12:33 Richard Purdie
  2018-12-05 12:33 ` [PATCH 2/3] oeqa/selftest/runqemu: Improve testcase failure handling Richard Purdie
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Richard Purdie @ 2018-12-05 12:33 UTC (permalink / raw)
  To: openembedded-core

We've seen a cryptic:

"ERROR: Fatal errors occurred in subprocesses, tracebacks printed above"

message from oe-selftest with no other traceback information. Improve the
traceback logging to try and give a better indication of any errors that is
ocurring.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
 meta/lib/oe/utils.py                        | 5 +++--
 meta/lib/oeqa/selftest/cases/oelib/utils.py | 4 ++++
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/meta/lib/oe/utils.py b/meta/lib/oe/utils.py
index d05f517a702..8a584d6ddd5 100644
--- a/meta/lib/oe/utils.py
+++ b/meta/lib/oe/utils.py
@@ -318,9 +318,10 @@ def multiprocess_launch(target, items, d, extraargs=None):
     for p in launched:
         p.join()
     if errors:
+        msg = ""
         for (e, tb) in errors:
-            bb.error(str(tb))
-        bb.fatal("Fatal errors occurred in subprocesses, tracebacks printed above")
+            msg = msg + str(e) + ": " + str(tb) + "\n"
+        bb.fatal("Fatal errors occurred in subprocesses:\n%s" % msg)
     return results
 
 def squashspaces(string):
diff --git a/meta/lib/oeqa/selftest/cases/oelib/utils.py b/meta/lib/oeqa/selftest/cases/oelib/utils.py
index 275aeda74eb..789c6f78d2d 100644
--- a/meta/lib/oeqa/selftest/cases/oelib/utils.py
+++ b/meta/lib/oeqa/selftest/cases/oelib/utils.py
@@ -66,6 +66,9 @@ class TestMultiprocessLaunch(TestCase):
 
         def dummyerror(msg):
             print("ERROR: %s" % msg)
+        def dummyfatal(msg):
+            print("ERROR: %s" % msg)
+            raise bb.BBHandledException()
 
         @contextmanager
         def captured_output():
@@ -79,6 +82,7 @@ class TestMultiprocessLaunch(TestCase):
 
         d = bb.data_smart.DataSmart()
         bb.error = dummyerror
+        bb.fatal = dummyfatal
 
         # Assert the function returns the right results
         result = multiprocess_launch(testfunction, ["3", "4", "5", "6"], d, extraargs=(d,))
-- 
2.19.1



^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-12-05 13:03 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-12-05 12:33 [PATCH 1/3] lib/oe/utils: Improve multiprocess_lauch exception handling Richard Purdie
2018-12-05 12:33 ` [PATCH 2/3] oeqa/selftest/runqemu: Improve testcase failure handling Richard Purdie
2018-12-05 12:33 ` [PATCH 3/3] oeqa/utils/qemurunner: Avoid tracebacks on closed files Richard Purdie
2018-12-05 13:03 ` ✗ patchtest: failure for "lib/oe/utils: Improve multipro..." and 2 more Patchwork

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.