qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Jeff Cody <jcody@redhat.com>
To: qemu-devel@nongnu.org
Cc: qemu-block@nongnu.org, jsnow@redhat.com, stefanha@redhat.com,
	kwolf@redhat.com, eblake@redhat.com
Subject: Re: [Qemu-devel] [PATCH v5 10/10] qemu-iotests: add support for running multi-threaded iotests
Date: Tue, 17 Oct 2017 23:45:36 -0400	[thread overview]
Message-ID: <20171018034536.GB17962@localhost.localdomain> (raw)
In-Reply-To: <f2da69a9931eb356c7fbc9e91a72af03210d72a5.1508257445.git.jcody@redhat.com>

On Tue, Oct 17, 2017 at 12:31:55PM -0400, Jeff Cody wrote:
> This adds support for running qemu-iotests in an arbitrary number
> of sub-processes, so that tests can be run in parallel.
> 
> This necessarily changes the output format, although it should still
> be familiar.  If you run in a single thread, the output format will
> largely be the same as before this patch.
> 
> To run in more than one process, use the '-j num' option, e.g.:
>   ./check -qcow2 -j 5
> 
> Some caveats:
> 
>     * Some output format options, such as timestamps, are currently
>       not compatible with multiple jobs.  If you select multiple
>       jobs, timestamps will be disabled.
> 
>     * Some tests may be more prone to failure with multiple jobs.
>       This isn't a flaw of multiple jobs per se, but rather of
>       fragile tests.  Some tests (181, 183) are very sensitive in
>       timing, and high cpu loads can cause them to fail.  It may be
>       worth adding support for 'single-thread only' tests in subsequent
>       patches, that complete designated single-thread jobs at the end.
> 
>     * Running protocol tests multi-threaded may fail, as multiple
>       tests may try to bind the same address.
> 
> If '-j' is not specified, the default is a single iotest being run
> at a time.
> 
> Signed-off-by: Jeff Cody <jcody@redhat.com>
> ---
>  tests/qemu-iotests/check      | 427 +++++++++++++++++++++++++++++-------------
>  tests/qemu-iotests/common.rc  |   2 +-
>  tests/qemu-iotests/iotests.py |   4 +-
>  3 files changed, 297 insertions(+), 136 deletions(-)
> 
> diff --git a/tests/qemu-iotests/check b/tests/qemu-iotests/check
> index a66f7b0..363617e 100755
> --- a/tests/qemu-iotests/check
> +++ b/tests/qemu-iotests/check

[...]

> +
> +# Even if interrupted, we want to wait until
> +# all tests have completed, so we can properly clean
> +# up after them via _check_results
> +function _wait_to_finish()
> +{
> +    while [ $jobs_running -gt 0 ]
> +    do
> +        i=0
> +        while [ $jobs_running -gt 0 ]
> +        do
> +            job=${job_slots[$i]}
> +            if [ $job -gt 0 ]
> +            then
> +                if [ -z "$(ps -o pid -h -p $job)" ]
> +                then
> +                    _check_results ${job_seq[$i]}
> +                    job_slots[$i]=0
> +                    job_seq[$i]=-1
> +                    let jobs_running--
> +                fi
> +            fi
> +            let i++
> +            let i=`expr $i % $MAX_JOBS`
> +            sleep 0.1
> +        done
> +    done

Oops.  That double while loop, while harmless, is spurious.  When I do a v6,
I'll remove the outer one when addressing any other review comments.

 

      reply	other threads:[~2017-10-18  3:45 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-17 16:31 [Qemu-devel] [PATCH v5 00/10] qemu-iotests improvements Jeff Cody
2017-10-17 16:31 ` [Qemu-devel] [PATCH v5 01/10] qemu-iotests: refuse to run if TEST_DIR contains spaces Jeff Cody
2017-10-18  1:03   ` Eric Blake
2017-10-18  3:05     ` Jeff Cody
2017-10-17 16:31 ` [Qemu-devel] [PATCH v5 02/10] qemu-iotests: set TEST_DIR to a unique dir for each test Jeff Cody
2017-10-17 16:31 ` [Qemu-devel] [PATCH v5 03/10] qemu-iotests: automatically clean up bash protocol servers Jeff Cody
2017-10-18  1:15   ` Eric Blake
2017-10-18 14:46   ` Paolo Bonzini
2017-10-18 15:03     ` Jeff Cody
2017-10-18 15:16       ` Paolo Bonzini
2017-10-18 15:34         ` Jeff Cody
2017-10-18 15:39           ` Paolo Bonzini
2017-10-18 15:50             ` Jeff Cody
2017-10-18 15:51               ` Paolo Bonzini
2017-10-18 16:19                 ` Jeff Cody
2017-10-18 16:39                   ` Paolo Bonzini
2017-10-18 17:27                     ` Jeff Cody
2017-10-19 10:23                       ` Paolo Bonzini
2017-10-19 14:52                         ` Jeff Cody
2017-10-19 21:03                           ` Paolo Bonzini
2017-10-18 15:06     ` Eric Blake
2017-10-18 15:43     ` Daniel P. Berrange
2017-10-17 16:31 ` [Qemu-devel] [PATCH v5 04/10] qemu-iotests: remove file cleanup from bash tests Jeff Cody
2017-10-18 13:46   ` Eric Blake
2017-10-18 13:56     ` Jeff Cody
2017-10-17 16:31 ` [Qemu-devel] [PATCH v5 05/10] qemu-iotests: change qemu pid and fd tracking / cleanup Jeff Cody
2017-10-18 13:59   ` Jeff Cody
2017-10-18 14:11     ` Eric Blake
2017-10-18 14:22   ` Eric Blake
2017-10-17 16:31 ` [Qemu-devel] [PATCH v5 06/10] qemu-iotests: make ./check automatically reap QEMU processes Jeff Cody
2017-10-18 14:24   ` Eric Blake
2017-10-17 16:31 ` [Qemu-devel] [PATCH v5 07/10] qemu-iotests: run python tests in own subdirectories Jeff Cody
2017-10-17 16:31 ` [Qemu-devel] [PATCH v5 08/10] qemu-iotests: modify python tests to run from subdir Jeff Cody
2017-10-17 16:31 ` [Qemu-devel] [PATCH v5 09/10] qemu-iotests: add option to save temp files on error Jeff Cody
2017-10-18 14:33   ` Eric Blake
2017-10-17 16:31 ` [Qemu-devel] [PATCH v5 10/10] qemu-iotests: add support for running multi-threaded iotests Jeff Cody
2017-10-18  3:45   ` Jeff Cody [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171018034536.GB17962@localhost.localdomain \
    --to=jcody@redhat.com \
    --cc=eblake@redhat.com \
    --cc=jsnow@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).