diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2023-09-21 17:49:25 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2023-09-22 07:45:17 +0100 |
commit | 7e6514b28b71f86fa911338e31ec4b284eb8fe46 (patch) | |
tree | 39252ae53c371cc47bc9ba1da1f412f7d19bbdbd /meta/lib/oeqa/core/utils/concurrencytest.py | |
parent | fbaa7da33b497088aa352f6cb8dbc02327310cd6 (diff) | |
download | poky-7e6514b28b71f86fa911338e31ec4b284eb8fe46.tar.gz |
oeqa: Streamline oe-selftest startup time
"bitbake -e" executions from get_bb_var calls are slow and slow down oe-selftest
startup. Rationalise the code to avoid them and minimise the number of "parsing"
locations we use by caching key variables and passing them around more.
This was particularly problematic with oe-selftest -j usage since it would
have multiple bitbake -e executions per process making parallel usage
particularly slow.
(From OE-Core rev: 3689cadeb07d76e66f97d890e844f899f69666fe)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa/core/utils/concurrencytest.py')
-rw-r--r-- | meta/lib/oeqa/core/utils/concurrencytest.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/meta/lib/oeqa/core/utils/concurrencytest.py b/meta/lib/oeqa/core/utils/concurrencytest.py index 4f77589b00..5e20b0e126 100644 --- a/meta/lib/oeqa/core/utils/concurrencytest.py +++ b/meta/lib/oeqa/core/utils/concurrencytest.py | |||
@@ -193,11 +193,12 @@ class dummybuf(object): | |||
193 | # | 193 | # |
194 | class ConcurrentTestSuite(unittest.TestSuite): | 194 | class ConcurrentTestSuite(unittest.TestSuite): |
195 | 195 | ||
196 | def __init__(self, suite, processes, setupfunc, removefunc): | 196 | def __init__(self, suite, processes, setupfunc, removefunc, bb_vars): |
197 | super(ConcurrentTestSuite, self).__init__([suite]) | 197 | super(ConcurrentTestSuite, self).__init__([suite]) |
198 | self.processes = processes | 198 | self.processes = processes |
199 | self.setupfunc = setupfunc | 199 | self.setupfunc = setupfunc |
200 | self.removefunc = removefunc | 200 | self.removefunc = removefunc |
201 | self.bb_vars = bb_vars | ||
201 | 202 | ||
202 | def run(self, result): | 203 | def run(self, result): |
203 | testservers, totaltests = fork_for_tests(self.processes, self) | 204 | testservers, totaltests = fork_for_tests(self.processes, self) |
@@ -243,7 +244,7 @@ class ConcurrentTestSuite(unittest.TestSuite): | |||
243 | def fork_for_tests(concurrency_num, suite): | 244 | def fork_for_tests(concurrency_num, suite): |
244 | testservers = [] | 245 | testservers = [] |
245 | if 'BUILDDIR' in os.environ: | 246 | if 'BUILDDIR' in os.environ: |
246 | selftestdir = get_test_layer() | 247 | selftestdir = get_test_layer(suite.bb_vars['BBLAYERS']) |
247 | 248 | ||
248 | test_blocks = partition_tests(suite, concurrency_num) | 249 | test_blocks = partition_tests(suite, concurrency_num) |
249 | # Clear the tests from the original suite so it doesn't keep them alive | 250 | # Clear the tests from the original suite so it doesn't keep them alive |