Experimental parallel test execution on MUTs (option --parallel), v2 #966
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Added new experimental feature: thread model for function
SingleTest::execute()
where for each target we have separate thread.Currently we are only building in parallel mbed SDK and libraries with dependencies.
Each unique MUT (mbed under test) is flashed separately one by one, but with this new feature we are able to flash multiple boards at the same time, run test case on hardware and get results in parallel.
Test execution time is reduced by
n
wheren
is number of MUTs (MUT: mbed under test).Rationale & limitations
We can experiment with usage of
--auto
and CI systems. Assuming that we are performing testing onn
unique mbed platforms we can gain almostn
folt test execution acceleration by flashing, executing and grabbing test results from each board at the same time.Note: this extension works also with
--auto
feature added by non-public (yet)mbed-ls
auto-detection module.Note: Building still will take some time so we are not accelerating building process which already is accelerated by multi-core compilation feature (
-j
switch). You can combine-j
and--parallel
to really messw ith your CPUs silicone ;-)Note: We want to explore new testing possibilities with existing test suite before we enable them for mbed 3.0 test suite.
Usage
To test in parallel with old sytle of configuration:
To test only detected by
mbed-ls
boards.Limitations
For now if we connect two boards of the same type, for example two Freedom K46F boards to our system test suite (
singletest.py
) will assume that we are testing only for one of the targets. Mbed-ls feedssingletest.py
with information about all targets but as above only one board of the same type will be tested.This limitation will be removed in future versions of test suite*.
Using
--parallel
means that:for each unique target with all declared toolchains.
E.g:
Done:
Missing:
Testing
Test MUTs configuration
Configuration, 4 boards; three Nucleo flavors and one Freedom K64F:
Building stuff first so when I execute parallel tests I do not build stuff (I want to see parallel testing velocity without build time constrains).
Note:
singletes.py
will still check if mbed SDK and dependencies should be rebuilt but this will be also done when non-parallel test execution is invoked.Parallel test execution
Non-parallel test execution
Measurement: Parallel vs non-parallel
Execution in parallel (threaded model with --parallel) scheme:
Note: K64F execution is far longer that any Nucleo board, so total time of parallel execution equals to longest test execution streak. In this case it is about 305.16 sec (where 304.17 sec is K64F test execution length):
Non-parallel execution scheme
Non-parallel execution just takes approximately sum of times for each platform to be executed.