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-15 15:27:49 +0100 |
commit | 9c5de5292f65ef1ae788c4da1b272a5da8055d77 (patch) | |
tree | a7f3d44ad9411346b01ec459c3d9211f9d9fbf59 /meta | |
parent | 9a4acc8ff3e59fa9ad74af04eae9462099b3111d (diff) | |
download | poky-9c5de5292f65ef1ae788c4da1b272a5da8055d77.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: 5df87fc7d3353abb8a8f4a25b544e7927c8b39eb)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 31e9dcda40aae3ce0801580c838928956e1455e3)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-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()) |