mirror of
https://git.yoctoproject.org/poky
synced 2026-04-04 14:02:22 +02:00
oeqa/selftest/runcmd: Add better debug for thread count mismatch failures
(From OE-Core rev: d15d0177d328fa3a126b9942bda177f6fae68505) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user