All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] oeqa/selftest/runcmd: Add better debug for thread count mismatch failures
@ 2020-06-22 21:38 Richard Purdie
  0 siblings, 0 replies; only message in thread
From: Richard Purdie @ 2020-06-22 21:38 UTC (permalink / raw)
  To: openembedded-core

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
 meta/lib/oeqa/selftest/cases/runcmd.py | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/meta/lib/oeqa/selftest/cases/runcmd.py b/meta/lib/oeqa/selftest/cases/runcmd.py
index 3755764ee71..a5ef1ea95fa 100644
--- a/meta/lib/oeqa/selftest/cases/runcmd.py
+++ b/meta/lib/oeqa/selftest/cases/runcmd.py
@@ -81,7 +81,7 @@ class RunCmdTests(OESelftestTestCase):
         self.assertEqual(result.status, -signal.SIGTERM)
         end = time.time()
         self.assertLess(end - start, self.TIMEOUT + self.DELTA)
-        self.assertEqual(numthreads, threading.active_count())
+        self.assertEqual(numthreads, threading.active_count(), msg="Thread counts were not equal before (%s) and after (%s), active threads: %s" % (numthreads, threading.active_count(), threading.enumerate()))
 
     def test_timeout_split(self):
         numthreads = threading.active_count()
@@ -91,13 +91,14 @@ class RunCmdTests(OESelftestTestCase):
         self.assertEqual(result.status, -signal.SIGTERM)
         end = time.time()
         self.assertLess(end - start, self.TIMEOUT + self.DELTA)
-        self.assertEqual(numthreads, threading.active_count())
+        self.assertEqual(numthreads, threading.active_count(), msg="Thread counts were not equal before (%s) and after (%s), active threads: %s" % (numthreads, threading.active_count(), threading.enumerate()))
 
     def test_stdin(self):
         numthreads = threading.active_count()
         result = runCmd("cat", data=b"hello world", timeout=self.TIMEOUT)
         self.assertEqual("hello world", result.output)
-        self.assertEqual(numthreads, threading.active_count())
+        self.assertEqual(numthreads, threading.active_count(), msg="Thread counts were not equal before (%s) and after (%s), active threads: %s" % (numthreads, threading.active_count(), threading.enumerate()))
+        self.assertEqual(numthreads, 1)
 
     def test_stdin_timeout(self):
         numthreads = threading.active_count()
@@ -106,7 +107,7 @@ class RunCmdTests(OESelftestTestCase):
         self.assertEqual(result.status, -signal.SIGTERM)
         end = time.time()
         self.assertLess(end - start, self.TIMEOUT + self.DELTA)
-        self.assertEqual(numthreads, threading.active_count())
+        self.assertEqual(numthreads, threading.active_count(), msg="Thread counts were not equal before (%s) and after (%s), active threads: %s" % (numthreads, threading.active_count(), threading.enumerate()))
 
     def test_log(self):
         log = MemLogger()
-- 
2.25.1


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2020-06-22 21:38 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-22 21:38 [PATCH] oeqa/selftest/runcmd: Add better debug for thread count mismatch failures Richard Purdie

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.