summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2021-07-06 12:06:24 +0100
committerSteve Sakoman <steve@sakoman.com>2021-07-11 06:19:43 -1000
commit5df87fc7d3353abb8a8f4a25b544e7927c8b39eb (patch)
treeeb00e5d213539445adff58eba806d6af36489ca9
parent317e334518c6394ecba4a3fdd4ba18b185822d22 (diff)
downloadopenembedded-core-5df87fc7d3353abb8a8f4a25b544e7927c8b39eb.tar.gz
oeqa/selftest/multiprocesslauch: Fix test race
Having two possible failures in multiprocesslauch creates a race where one failure may occur and stop processes being lanuched meaning the second failure may not be seen. Rather than having periodic races appearing on the autobuilder, only have one failure, making the test much more deterministic. [YOCTO #13054] Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 31e9dcda40aae3ce0801580c838928956e1455e3) Signed-off-by: Steve Sakoman <steve@sakoman.com>
-rw-r--r--meta/lib/oeqa/selftest/cases/oelib/utils.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/meta/lib/oeqa/selftest/cases/oelib/utils.py b/meta/lib/oeqa/selftest/cases/oelib/utils.py
index a7214beb4c..bbf67bf9c9 100644
--- a/meta/lib/oeqa/selftest/cases/oelib/utils.py
+++ b/meta/lib/oeqa/selftest/cases/oelib/utils.py
@@ -64,7 +64,7 @@ class TestMultiprocessLaunch(TestCase):
import bb
def testfunction(item, d):
- if item == "2" or item == "1":
+ if item == "2":
raise KeyError("Invalid number %s" % item)
return "Found %s" % item
@@ -99,5 +99,4 @@ class TestMultiprocessLaunch(TestCase):
# Assert the function prints exceptions
with captured_output() as (out, err):
self.assertRaises(bb.BBHandledException, multiprocess_launch, testfunction, ["1", "2", "3", "4", "5", "6"], d, extraargs=(d,))
- self.assertIn("KeyError: 'Invalid number 1'", out.getvalue())
self.assertIn("KeyError: 'Invalid number 2'", out.getvalue())