Add a proper support for commands execution while a test is running
Created by: derkling
While a test is executed, we should ensure the most quite and stable execution environment, such that only test-specific tasks are in execution and exercise the scheduler behaviours.
Unfortunately some tests, like the one merged in #325, can require actions to be performed while the test is in execution. The main issue is that mimicking user actions using the System API send commands from the host to the target while the test is running. This results in a set of new tasks being generated for example at each and every swipe action, tasks which can affects the test itself. These new tasks are quite evident in the collected trace and they can potentially impact quite a lot in task placement and ultimately in the overall test performance.
There are two possible solutions:
-
find a way to ensure that the ADB server is pinned on CPU0, thus forcing all the commands we send to run on that CPU only. This should mitigate the side-effect of the test instrumentation on the scheduler behaviours.
-
think about a possible API extension for the Benchmark class which allows to generate on-the-fly scripts to be kicked-off on target and executed on background without requiring to generate more task.
The first solution is worth to have in any case and it's more simple to introduce. The second one is much more interesting but can be introduced for completeness as a second step.