From: Peter Xu Subject: [kvm-unit-tests PATCH v3 2/2] run_tests: allow run tests in parallel Date: Fri, 6 Jan 2017 11:33:01 +0800 Message-ID: <1483673581-7843-3-git-send-email-peterx@redhat.com> References: <1483673581-7843-1-git-send-email-peterx@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Paolo Bonzini , Andrew Jones , peterx@redhat.com, =?UTF-8?q?Radim=20Kr=C4=8Dm=C3=A1=C5=99?= To: qemu-devel@nongnu.org, kvm@vger.kernel.org Return-path: Received: from mx1.redhat.com ([209.132.183.28]:45824 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S936262AbdAFDdV (ORCPT ); Thu, 5 Jan 2017 22:33:21 -0500 In-Reply-To: <1483673581-7843-1-git-send-email-peterx@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: 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ář Signed-off-by: Peter Xu --- run_tests.sh | 12 ++++++++++-- scripts/functions.bash | 17 ++++++++++++++++- scripts/global.bash | 11 +++++++++++ 3 files changed, 37 insertions(+), 3 deletions(-) diff --git a/run_tests.sh b/run_tests.sh index e1bb3a6..a4fc895 100755 --- a/run_tests.sh +++ b/run_tests.sh @@ -14,10 +14,11 @@ function usage() { cat <