diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2021-07-06 12:06:24 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2021-07-07 11:39:42 +0100 |
commit | e10425cc7bf19e0602819480a7f326314f666a4d (patch) | |
tree | b1f41deff35e526a5039d89eac8a97d21e479838 | |
parent | 5c928099edcb8c7d7ca46071b6d82e12e71f18bc (diff) | |
download | poky-e10425cc7bf19e0602819480a7f326314f666a4d.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]
(From OE-Core rev: 31e9dcda40aae3ce0801580c838928956e1455e3)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | meta/lib/oeqa/selftest/cases/oelib/utils.py | 3 |
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): | |||
64 | import bb | 64 | import bb |
65 | 65 | ||
66 | def testfunction(item, d): | 66 | def testfunction(item, d): |
67 | if item == "2" or item == "1": | 67 | if item == "2": |
68 | raise KeyError("Invalid number %s" % item) | 68 | raise KeyError("Invalid number %s" % item) |
69 | return "Found %s" % item | 69 | return "Found %s" % item |
70 | 70 | ||
@@ -99,5 +99,4 @@ class TestMultiprocessLaunch(TestCase): | |||
99 | # Assert the function prints exceptions | 99 | # Assert the function prints exceptions |
100 | with captured_output() as (out, err): | 100 | with captured_output() as (out, err): |
101 | self.assertRaises(bb.BBHandledException, multiprocess_launch, testfunction, ["1", "2", "3", "4", "5", "6"], d, extraargs=(d,)) | 101 | self.assertRaises(bb.BBHandledException, multiprocess_launch, testfunction, ["1", "2", "3", "4", "5", "6"], d, extraargs=(d,)) |
102 | self.assertIn("KeyError: 'Invalid number 1'", out.getvalue()) | ||
103 | self.assertIn("KeyError: 'Invalid number 2'", out.getvalue()) | 102 | self.assertIn("KeyError: 'Invalid number 2'", out.getvalue()) |