summaryrefslogtreecommitdiffstats
path: root/lib/bb/tests/runqueue.py
AgeCommit message (Collapse)Author
2021-02-20event: Fix broken builds when multiconfig has a hyphen in the nameJoshua Watt
5f7fdf7b2d ("bitbake: event: Prevent bitbake from executing event handler for wrong multiconfig target") broke multiconfig builds contain a hyphen, since it's attempt to use the multiconfig as part of a function name and python functions are not allowed to contain a hyphen. Rework the bitbake multiconfig test to test a multiconfig with a hyphen and one with an underscore to validate this doesn't break in the future. Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-06-11bitbake: tests: Add mcdepends testJoshua Watt
Adds a test to validate that mcdepends causes the dependent tasks to build, and also that a change in the dependent task causes the dependee task to re-execute. Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-06-08bitbake: tests: Add tests for BBMASK in multiconfigJoshua Watt
Adds a test to validate that multiconfigs can independently mask off recipes by setting BBMASK. See the test description for further information about how the test works. Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-01-19lib: remove unused importsFrazer Clews
removed unused imports which made the code harder to read, and slightly but less efficient Signed-off-by: Frazer Clews <frazer.clews@codethink.co.uk> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-11-27tests/runqueue: Fix to match recent task migration fixesRichard Purdie
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-10-02tests/runqueue: Fix hashserve shutdown raceRichard Purdie
The hashserve can delete its socket whilst the cleanup us happening leading to backtraces and test failures. Add code to avoid this race condition. [YOCTO #13542] Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-09-27runqueue: Change task migration behaviour for rerunning setscene tasksRichard Purdie
Currently runqueue will rerun setscene tasks multiple times as hashes change. This has caused numerous problems since a setscene task may become "unavailable" for some future signature combination and the code then can't easily "unskip" tasks its already passed into the execution queue. At least for now, only run setscene once and assume they're equivalent at that point. In practise that has been much more stable in testing. Tweak the test to match the change in behaviour. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-09-27runqueue: Fix task migration problemsRichard Purdie
Tasks were not migrating consistently, particularly: * if a task was rehashed which had already run * if a task which was valid became invalid due to a rehash We need to always run the migration code for rehashed tasks and then reprocess them for hash validity. This means rearranging the code. It also means several tests are no longer correct and can't be written correctly to work on all possible workflows so those are removed. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-09-18bitbake: Rework hash equivalenceJoshua Watt
Reworks the hash equivalence server to address performance issues that were encountered with the REST mechanism used previously, particularly during the heavy request load encountered during signature generation. Notable changes are: 1) The server protocol is no longer HTTP based. Instead, it uses a simpler JSON over a streaming protocol link. This protocol has much lower overhead than HTTP since it eliminates the HTTP headers. 2) The hash equivalence server can either bind to a TCP port, or a Unix domain socket. Unix domain sockets are more efficient for local communication, and so are preferred if the user enables hash equivalence only for the local build. The arguments to the 'bitbake-hashserve' command have been updated accordingly. 3) The value to which BB_HASHSERVE should be set to enable a local hash equivalence server is changed to "auto" instead of "localhost:0". The latter didn't make sense when the local server was using a Unix domain socket. 4) Clients are expected to keep a persistent connection to the server instead of creating a new connection each time a request is made for optimal performance. 5) Most of the client logic has been moved to the hashserve module in bitbake. This makes it easier to share the client code. 6) A new bitbake command has been added called 'bitbake-hashclient'. This command can be used to query a hash equivalence server, including fetching the statistics and running a performance stress test. 7) The table indexes in the SQLite database have been updated to optimize hash lookups. This change is backward compatible, as the database will delete the old indexes first if they exist. 8) The server has been reworked to use python async to maximize performance with persistently connected clients. This requires Python 3.5 or later. Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-08-15tests/runqueue: Fix testsRichard Purdie
There were paths being accidentally included in some of the hashserv tests. Remove that and update the hashes so the tests work independently of paths. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-08-14runqueue: Fix event timing raceRichard Purdie
The event from the task notifiing of hash equivalency should only be processed when the task completes. This can otherwise result in a race where a dependent task may run before the original task completes causing various failures. To make this work reliably, the code had to be restructured quite a bit. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-08-14tests/runqueue: Add further hash equivalence testsRichard Purdie
Add some extra hash equivalence runqueue tests based on recent scenarios that caused problems during testing. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-08-06tests/runqueue: Add hashserv+runqueue testRichard Purdie
Add a test which tests the runqueue adaptations for hash equivalency. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-07-18runqueue: Fix non setscene tasks targets being lostRichard Purdie
If you specify both setscene and non-setscene tasks on the commandline, the non-setscene tasks could be missed, e.g. "bitbake X:do_patch X:do_populate_sysroot" and do_patch would fail to run. Fix the problem in runqueue and add a testcase. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-07-16runqueue: Optimise multiconfig with overlapping setsceneRichard Purdie
Currently if a multiconfig build contains different configurations which have overlapping sstate artefacts, it will build them multiple times. This is clearly suboptimal and not what users want/expect. This adds code to detect this and stall all but one of the setscne tasks so that once its built, it can be found by the other tasks. We take care to iterate the multiconfigs in order so try and avoid dependency loops. We also match on PN+taskname+taskhash since this is what we know sstate in OE-Core would use. There are some tasks even within a multiconfig which match hashes (mostly do_populate_lic tasks) but those have a much higher chance of circular dependency so aren't work attempting to optimise. If a deadlock does occur the build will be slower but there is code to unbreak such a deadlock so it hopefully doens't break anything. Comments are injected into the test tasks so they have different task hashes and a new test for this optimisation is added. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-07-15tests: Add initial scenario based test for runqueueRichard Purdie
We need some tests for runqueue, its been something which has been hard to test for a long time. Add some dummy metadata to allow this, mirroring the OE structure in spirit. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>