qemu-block
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v4 3/3] iotests: modify test 040 to use JobRunner


From: Kevin Wolf
Subject: Re: [PATCH v4 3/3] iotests: modify test 040 to use JobRunner
Date: Fri, 15 May 2020 11:46:28 +0200

Am 14.05.2020 um 21:37 hat John Snow geschrieben:
> 
> 
> On 5/14/20 11:53 AM, Kevin Wolf wrote:
> > Am 14.05.2020 um 04:25 hat John Snow geschrieben:
> >> Instead of having somewhat reproduced it for itself.
> >>
> >> Signed-off-by: John Snow <address@hidden>
> > 
> > I think you should pass auto_dismiss=True to the JobRunner, or (probably
> > preferable) change prepare_and_start_job() to start the job with
> > auto_dismiss=False.
> > 
> > Kevin
> > 
> 
> okay, I'll try that out and see if I like it.
> 
> 
> Wild tangents, as is my normal:
> 
> I also think it would be neat, in some sense, to provide a job creation
> abstraction where creating the QMP command in python also creates the
> runner with the right parameters based on how you initialized it.
> 
> I've not given these even a proper three minutes think, but some
> generalized interface for managing the creation of jobs to use in
> concert with the job runner would be slick.

JobRunner could have a static method that starts a job (it would take
the same options as qmp() and forward everything to qmp(), except that
it parses auto_* first) and returns a JobRunner object that you can run
later.

> (What reminds me of this is needing to remember and understand if I
> started something with auto_dismiss or not, which jobs it defaults to
> which for, etc. Streamlining the creation and runner could be slick for
> faster test-writing in normative cases.)

Yes.

In general, I think we should keep tests simple (even if that means some
duplication) and avoid overengineering testing infrastructure because we
could well sink more time there than we'll ever get back, but I guess
small and simple wrappers like in this case can't hurt.

Kevin




reply via email to

[Prev in Thread] Current Thread [Next in Thread]