summaryrefslogtreecommitdiffstats
path: root/meta/lib
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2020-06-22 22:35:07 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-07-02 16:12:36 +0100
commit7267bf59fcfc137e478ab1f892cf545ef1d99ce5 (patch)
tree8e8444b01d1398c2609813764df22447c907e2dd /meta/lib
parentc2adb605316b3fd17a749afa99156bcace9a927f (diff)
downloadpoky-7267bf59fcfc137e478ab1f892cf545ef1d99ce5.tar.gz
oeqa/selftest/runcmd: Add better debug for thread count mismatch failures
(From OE-Core rev: 773f97c6f56ed98a7b0821358d7435ed3ea7a3d6) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit d15d0177d328fa3a126b9942bda177f6fae68505) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib')
-rw-r--r--meta/lib/oeqa/selftest/cases/runcmd.py9
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):
81 self.assertEqual(result.status, -signal.SIGTERM) 81 self.assertEqual(result.status, -signal.SIGTERM)
82 end = time.time() 82 end = time.time()
83 self.assertLess(end - start, self.TIMEOUT + self.DELTA) 83 self.assertLess(end - start, self.TIMEOUT + self.DELTA)
84 self.assertEqual(numthreads, threading.active_count()) 84 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()))
85 85
86 def test_timeout_split(self): 86 def test_timeout_split(self):
87 numthreads = threading.active_count() 87 numthreads = threading.active_count()
@@ -91,13 +91,14 @@ class RunCmdTests(OESelftestTestCase):
91 self.assertEqual(result.status, -signal.SIGTERM) 91 self.assertEqual(result.status, -signal.SIGTERM)
92 end = time.time() 92 end = time.time()
93 self.assertLess(end - start, self.TIMEOUT + self.DELTA) 93 self.assertLess(end - start, self.TIMEOUT + self.DELTA)
94 self.assertEqual(numthreads, threading.active_count()) 94 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()))
95 95
96 def test_stdin(self): 96 def test_stdin(self):
97 numthreads = threading.active_count() 97 numthreads = threading.active_count()
98 result = runCmd("cat", data=b"hello world", timeout=self.TIMEOUT) 98 result = runCmd("cat", data=b"hello world", timeout=self.TIMEOUT)
99 self.assertEqual("hello world", result.output) 99 self.assertEqual("hello world", result.output)
100 self.assertEqual(numthreads, threading.active_count()) 100 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()))
101 self.assertEqual(numthreads, 1)
101 102
102 def test_stdin_timeout(self): 103 def test_stdin_timeout(self):
103 numthreads = threading.active_count() 104 numthreads = threading.active_count()
@@ -106,7 +107,7 @@ class RunCmdTests(OESelftestTestCase):
106 self.assertEqual(result.status, -signal.SIGTERM) 107 self.assertEqual(result.status, -signal.SIGTERM)
107 end = time.time() 108 end = time.time()
108 self.assertLess(end - start, self.TIMEOUT + self.DELTA) 109 self.assertLess(end - start, self.TIMEOUT + self.DELTA)
109 self.assertEqual(numthreads, threading.active_count()) 110 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()))
110 111
111 def test_log(self): 112 def test_log(self):
112 log = MemLogger() 113 log = MemLogger()