Skip to content

iotests: add JobRunner framework

John Snow qemu-devel 4 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest3 patches 11 repliesIn review
  2. v33 patches 0 repliesSuperseded
  3. v23 patches 0 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v12 patches6 repliesSuperseded

Changes in v4 from the cover letter

- Rebased on current master.
- Converted new usages is test 055.

Patches in v4 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3qmp.py: change event_wait to use a dictpython/qemu/machine.py tests/qemu-iotests/040 tests/qemu-iotests/260 +1 more+22 -216 replies
2/3iotests: add JobRunner classtests/qemu-iotests/055 tests/qemu-iotests/155 tests/qemu-iotests/255 +3 more+225 -832 replies
3/3iotests: modify test 040 to use JobRunnertests/qemu-iotests/040+25 -263 replies

Reviews trailers per patch

1 of 3 patches has a Reviewed-by or Acked-by.

PatchKevin Wolf
1/3
2/3R-b
3/3

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v4 thread

Cover letter [PATCH v4 0/3] iotests: add JobRunner framework

The basic idea is to make a generic job runtime manager and allow callers to subclass the manager. Then, instead of adding callback arguments to the function all the time, we have à la carte customization of the loop.

To showcase this a little bit, I removed the pre_finalization argument and made existing callers use a custom JobRunner; and then converted test 040 to use this style of job runner.

Is it a simplification? No. Is it cool? Maybe. Did it remove the duplicated job-running code in 040? yes.

As of V4, I'm not sure I really want to pursue this at the moment; it does feel a bit harder to use than the old interface; though it's more "complete". I might look into refining the idea and trying to include it directly in python/qemu; and providing some more 'bespoke' wrappers in iotests that make using it in the test framework a little less cumbersome.

Regardless, I am posting it to the list for archiving for now.

v4:
- Rebased on current master.
- Converted new usages is test 055.

V3:
- Rebased on logging series v8
- Converted 155's new usage of job_run

V2:
- Rebased on logging series; logging conditionals are pretty now.
- Inlined callback login in 257
- No longer based on bitmap-populate job (no test 287)
- Moved super() call to the beginning of test 040's callback
- Added docstrings and type annotations

John Snow (3):
qmp.py: change event_wait to use a dict
iotests: add JobRunner class
iotests: modify test 040 to use JobRunner

 python/qemu/machine.py        |  10 +-
 tests/qemu-iotests/040        |  51 +++++----
 tests/qemu-iotests/055        |  17 +--
 tests/qemu-iotests/155        |  11 +-
 tests/qemu-iotests/255        |   9 +-
 tests/qemu-iotests/257        |  54 +++++----
 tests/qemu-iotests/260        |   5 +-
 tests/qemu-iotests/iotests.py | 206 +++++++++++++++++++++++++---------
 tests/qemu-iotests/pylintrc   |  11 ++
 9 files changed, 258 insertions(+), 116 deletions(-)
Signature · 1 line
2.21.1