[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v4 2/3] iotests: add JobRunner class
From: |
Kevin Wolf |
Subject: |
Re: [PATCH v4 2/3] iotests: add JobRunner class |
Date: |
Thu, 14 May 2020 17:40:59 +0200 |
Am 14.05.2020 um 04:25 hat John Snow geschrieben:
> The idea is that instead of increasing the arguments to job_run all the
> time, create a more general-purpose job runner that can be subclassed to
> do interesting things with.
>
> pylint note: the 'callbacks' option guards against unused warning
> arguments in functions designated as callbacks. It does not currently
> guard against "no-self-use" though; hence a once-off ignore.
>
> mypy note: QapiEvent is only a weak alias; it's fully interchangable
> with the type it's declared as. In the future, we may wish to tighten
> these types. For now, this communicates the rough shape of the type and
> (more importantly) the intent.
>
> Signed-off-by: John Snow <address@hidden>
> + # Listen for these events with these parameters:
> + self._events = {
> + 'BLOCK_JOB_COMPLETED': match_device,
> + 'BLOCK_JOB_CANCELLED': match_device,
> + 'BLOCK_JOB_ERROR': match_device,
> + 'BLOCK_JOB_READY': match_device,
> + 'BLOCK_JOB_PENDING': match_id,
> + 'JOB_STATUS_CHANGE': match_id
> + }
The old code had a trailing comma here in case we need to add more
events later. Anyway:
Reviewed-by: Kevin Wolf <address@hidden>
[PATCH v4 2/3] iotests: add JobRunner class, John Snow, 2020/05/13
- Re: [PATCH v4 2/3] iotests: add JobRunner class,
Kevin Wolf <=
[PATCH v4 3/3] iotests: modify test 040 to use JobRunner, John Snow, 2020/05/13