diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2020-06-22 22:35:07 +0100 |
---|---|---|
committer | Steve Sakoman <steve@sakoman.com> | 2020-06-26 11:53:05 -1000 |
commit | 773f97c6f56ed98a7b0821358d7435ed3ea7a3d6 (patch) | |
tree | 2a5622ee9ebde72830e0deb64a5c322f4bd72426 /meta/lib/oeqa/selftest/cases/runcmd.py | |
parent | 60ae9e6d31dcfc06961fedf7622a204162d3f464 (diff) | |
download | openembedded-core-contrib-773f97c6f56ed98a7b0821358d7435ed3ea7a3d6.tar.gz |
oeqa/selftest/runcmd: Add better debug for thread count mismatch failures
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit d15d0177d328fa3a126b9942bda177f6fae68505)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Diffstat (limited to 'meta/lib/oeqa/selftest/cases/runcmd.py')
-rw-r--r-- | meta/lib/oeqa/selftest/cases/runcmd.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/meta/lib/oeqa/selftest/cases/runcmd.py b/meta/lib/oeqa/selftest/cases/runcmd.py index 3755764ee7..a5ef1ea95f 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() |