qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Huth <thuth@redhat.com>
To: Emanuele Giuseppe Esposito <eesposit@redhat.com>, qemu-devel@nongnu.org
Cc: Kevin Wolf <kwolf@redhat.com>,
	Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>,
	Peter Maydell <peter.maydell@linaro.org>,
	Hanna Czenczek <hreitz@redhat.com>,
	Stefan Hajnoczi <stefanha@redhat.com>
Subject: Re: [PATCH] tests/unit/test-blockjob: Re-enable complete_in_standby test
Date: Wed, 26 Apr 2023 10:45:46 +0200	[thread overview]
Message-ID: <a11743c0-5f9b-fa8c-14d9-8e724bf4cee0@redhat.com> (raw)
In-Reply-To: <20230426081601.2567990-1-eesposit@redhat.com>

On 26/04/2023 10.16, Emanuele Giuseppe Esposito wrote:
> Pause the job while draining so that pause_count will be
> increased and bdrv_drain_all_end() won't reset it to 0, so the
> job will not continue.
> 
> With this fix, the test is not flaky anymore.
> 
> Additionally remove useless aiocontext lock around bdrv_drain_all_end()
> in test_complete_in_standby().
> 
> Fixes: b6903cbe3a2 "tests/unit/test-blockjob: Disable
> complete_in_standby test"
> Suggested-by: Hanna Czenczek <hreitz@redhat.com>
> Signed-off-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
> ---
>   tests/unit/test-blockjob.c | 17 +++++++----------
>   1 file changed, 7 insertions(+), 10 deletions(-)
> 
> diff --git a/tests/unit/test-blockjob.c b/tests/unit/test-blockjob.c
> index a130f6fefb..46d720aeee 100644
> --- a/tests/unit/test-blockjob.c
> +++ b/tests/unit/test-blockjob.c
> @@ -488,11 +488,15 @@ static void test_complete_in_standby(void)
>       bdrv_drain_all_begin();
>       assert_job_status_is(job, JOB_STATUS_STANDBY);
>   
> +    /*
> +     * Increase pause_count so that the counter is
> +     * unbalanced and job won't resume
> +     */
> +    job_pause(job);
> +
>       /* Lock the IO thread to prevent the job from being run */

I guess the above comment should now be removed, too?

> -    aio_context_acquire(ctx);
>       /* This will schedule the job to resume it */
>       bdrv_drain_all_end();
> -    aio_context_release(ctx);

  Thomas



  reply	other threads:[~2023-04-26  8:46 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-26  8:16 [PATCH] tests/unit/test-blockjob: Re-enable complete_in_standby test Emanuele Giuseppe Esposito
2023-04-26  8:45 ` Thomas Huth [this message]
2023-04-26 10:40   ` Emanuele Giuseppe Esposito

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=a11743c0-5f9b-fa8c-14d9-8e724bf4cee0@redhat.com \
    --to=thuth@redhat.com \
    --cc=eesposit@redhat.com \
    --cc=hreitz@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    --cc=vsementsov@yandex-team.ru \
    /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).