qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Kevin Wolf <kwolf@redhat.com>
To: Stefan Hajnoczi <stefanha@redhat.com>
Cc: qemu-devel@nongnu.org, Paolo Bonzini <pbonzini@redhat.com>,
	Markus Armbruster <armbru@redhat.com>,
	Michael Roth <michael.roth@amd.com>,
	qemu-block@nongnu.org, Fiona Ebner <f.ebner@proxmox.com>,
	Hanna Reitz <hreitz@redhat.com>
Subject: Re: [PATCH 2/3] iotests: port 141 to Python for reliable QMP testing
Date: Thu, 18 Jan 2024 16:36:34 +0100	[thread overview]
Message-ID: <ZalFggPWyDEfZhRc@redhat.com> (raw)
In-Reply-To: <20240118145513.GA1490473@fedora>

[-- Attachment #1: Type: text/plain, Size: 2531 bytes --]

Am 18.01.2024 um 15:55 hat Stefan Hajnoczi geschrieben:
> On Wed, Jan 17, 2024 at 07:04:06PM +0100, Kevin Wolf wrote:
> > Am 16.01.2024 um 20:00 hat Stefan Hajnoczi geschrieben:
> > > The common.qemu bash functions allow tests to interact with the QMP
> > > monitor of a QEMU process. I spent two days trying to update 141 when
> > > the order of the test output changed, but found it would still fail
> > > occassionally because printf() and QMP events race with synchronous QMP
> > > communication.
> > > 
> > > I gave up and ported 141 to the existing Python API for QMP tests. The
> > > Python API is less affected by the order in which QEMU prints output
> > > because it does not print all QMP traffic by default.
> > > 
> > > The next commit changes the order in which QMP messages are received.
> > > Make 141 reliable first.
> > > 
> > > Cc: Hanna Czenczek <hreitz@redhat.com>
> > > Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
> > 
> > iotests 297 finds problems with the new Python code:
> > 
> >  === pylint ===
> > +************* Module 141
> > +141:82:0: C0301: Line too long (86/79) (line-too-long)
> > +141:93:0: C0301: Line too long (86/79) (line-too-long)
> > +141:94:0: C0301: Line too long (80/79) (line-too-long)
> > +141:106:0: C0301: Line too long (85/79) (line-too-long)
> > +141:107:0: C0301: Line too long (82/79) (line-too-long)
> > +141:109:0: C0301: Line too long (82/79) (line-too-long)
> > +141:117:0: C0301: Line too long (86/79) (line-too-long)
> > +141:120:0: C0301: Line too long (86/79) (line-too-long)
> > +141:129:0: C0301: Line too long (86/79) (line-too-long)
> >  === mypy ===
> > +141:104: error: Value of type variable "Msg" of "log" cannot be "dict[str, Any] | None"  [type-var]
> > +141:114: error: Value of type variable "Msg" of "log" cannot be "dict[str, Any] | None"  [type-var]
> > +Found 2 errors in 1 file (checked 37 source files)
> 
> I'm not sure how to run this but I manually ran pylint and mypy and
> fixed those errors. Can you share how you ran this?

I already answered this in IRC, but for the record: This is from running
qemu-iotests 297, which is kind of a meta-test that runs the linters on
Python files in qemu-iotests.

> The mypy errors are because the type system cannot express that
> event_wait() only returns None when timeout=0. That's not the case in
> 141 but mypy complains anyway, so I added an assertion that event is not
> None to silence mypy.

Sounds like the right solution to me.

Kevin

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2024-01-18 15:37 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-16 19:00 [PATCH 0/3] monitor: only run coroutine commands in qemu_aio_context Stefan Hajnoczi
2024-01-16 19:00 ` [PATCH 1/3] iotests: add filter_qmp_generated_node_ids() Stefan Hajnoczi
2024-01-17 16:13   ` Kevin Wolf
2024-01-16 19:00 ` [PATCH 2/3] iotests: port 141 to Python for reliable QMP testing Stefan Hajnoczi
2024-01-17 16:13   ` Kevin Wolf
2024-01-17 18:04   ` Kevin Wolf
2024-01-18 14:55     ` Stefan Hajnoczi
2024-01-18 15:36       ` Kevin Wolf [this message]
2024-01-16 19:00 ` [PATCH 3/3] monitor: only run coroutine commands in qemu_aio_context Stefan Hajnoczi
2024-01-17 18:10   ` Kevin Wolf
2024-01-18 15:47   ` Fiona Ebner
2024-02-03  9:01   ` Michael Tokarev
2024-02-03 11:30     ` Michael Tokarev
2024-02-13 20:19       ` Stefan Hajnoczi
2024-01-18 11:20 ` [PATCH 0/3] " Michael Tokarev
2024-01-29 11:38 ` Peter Maydell
2024-02-03  2:19   ` YangHang Liu

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=ZalFggPWyDEfZhRc@redhat.com \
    --to=kwolf@redhat.com \
    --cc=armbru@redhat.com \
    --cc=f.ebner@proxmox.com \
    --cc=hreitz@redhat.com \
    --cc=michael.roth@amd.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    /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).