[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v8 11/20] jobs: use job locks also in the unit tests
From: |
Stefan Hajnoczi |
Subject: |
Re: [PATCH v8 11/20] jobs: use job locks also in the unit tests |
Date: |
Tue, 5 Jul 2022 09:04:53 +0100 |
On Wed, Jun 29, 2022 at 10:15:29AM -0400, Emanuele Giuseppe Esposito wrote:
> Add missing job synchronization in the unit tests, with
> explicit locks.
>
> We are deliberately using _locked functions wrapped by a guard
> instead of a normal call because the normal call will be removed
> in future, as the only usage is limited to the tests.
>
> In other words, if a function like job_pause() is/will be only used
> in tests to avoid:
>
> WITH_JOB_LOCK_GUARD(){
> job_pause_locked();
> }
>
> then it is not worth keeping job_pause(), and just use the guard.
>
> Note: at this stage, job_{lock/unlock} and job lock guard macros
> are *nop*.
>
> Signed-off-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
> ---
> tests/unit/test-bdrv-drain.c | 76 +++++++++++++++++---------
> tests/unit/test-block-iothread.c | 8 ++-
> tests/unit/test-blockjob-txn.c | 24 +++++---
> tests/unit/test-blockjob.c | 94 ++++++++++++++++++++++++--------
> 4 files changed, 141 insertions(+), 61 deletions(-)
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
signature.asc
Description: PGP signature
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: [PATCH v8 11/20] jobs: use job locks also in the unit tests,
Stefan Hajnoczi <=