Re: [kvm-unit-tests PATCH v2 2/2] run_tests: allow run tests in parallel

Radim Krčmář
2017-01-04T15:09:42Z

2017-01-03 18:10+0800, Peter Xu:
> run_task.sh is getting slow. This patch is trying to make it faster by
> running the tests concurrently.
>
> We provide a new parameter "-j" for the run_tests.sh, which can be used
> to specify how many run queues we want for the tests. Default queue
> length is 1, which is the old behavior.
>
> Quick test on my laptop (4 cores, 2 threads each) shows 3x speed boost:
>
> |-----------------+-----------|
> | command | time used |
> |-----------------+-----------|
> | run_test.sh | 75s |
> | run_test.sh -j8 | 27s |
> |-----------------+-----------|
>
> Suggested-by: Radim Krčmář <rkrcmar@redhat.com>
> Signed-off-by: Peter Xu <peterx@redhat.com>
> ---
> run_tests.sh | 12 ++++++++++--
> scripts/functions.bash | 15 ++++++++++++++-
> scripts/global.bash | 11 +++++++++++
> 3 files changed, 35 insertions(+), 3 deletions(-)

I like this diffstat a lot more, thanks :)

The script doesn't handle ^C well now (at least), which can be worked
around with

trap exit SIGINT

but it would be nice to know if receiving signals in `wait` can't be
fixed.