From: Fabiano Rosas <farosas@suse.de>
To: "Peter Maydell" <peter.maydell@linaro.org>,
"Daniel P. Berrangé" <berrange@redhat.com>
Cc: Thomas Huth <thuth@redhat.com>,
qemu-devel@nongnu.org, Peter Xu <peterx@redhat.com>,
Markus Armbruster <armbru@redhat.com>
Subject: Re: [RFC PATCH 0/2] qtest: Log verbosity changes
Date: Fri, 06 Sep 2024 11:42:00 -0300 [thread overview]
Message-ID: <87r09wlu87.fsf@suse.de> (raw)
In-Reply-To: <CAFEAcA-naWfN5sLSJ3uS6VjC3HWvyaGqAk0=B_iqTYgtJOH+ow@mail.gmail.com>
Peter Maydell <peter.maydell@linaro.org> writes:
> On Fri, 6 Sept 2024 at 09:14, Daniel P. Berrangé <berrange@redhat.com> wrote:
>>
>> On Fri, Sep 06, 2024 at 08:16:31AM +0200, Thomas Huth wrote:
>> > On 05/09/2024 23.03, Fabiano Rosas wrote:
>> > > Hi,
>> > >
>> > > This series silences QEMU stderr unless the QTEST_LOG variable is set
>> > > and silences -qtest-log unless both QTEST_LOG and gtest's --verbose
>> > > flag is passed.
>> > >
>> > > This was motivated by Peter Maydell's ask to suppress deprecation
>> > > warn_report messages from the migration-tests and by my own
>> > > frustration over noisy output from qtest.
>
> This isn't what I want, though -- what I want is that a
> qtest run should not print "warning:" messages for things
> that we expect to happen when we run that test. I *do* want
> warnings for things that we do not expect to happen when
> we run the test.
>
>> > Not sure whether we want to ignore stderr by default... we might also miss
>> > important warnings or error messages that way...?
>>
>> I would prefer if our tests were quiet by default, and just printed
>> clear pass/fail notices without extraneous fluff. Having an opt-in
>> to see full messages from stderr feels good enough for debugging cases
>> where you need more info from a particular test.
>
> I find it is not uncommon that something fails and
> you don't necessarily have the option to re-run it with
> the "give me the error message this time" flag turn on.
> CI is just the most obvious example; other kinds of
> intermittent failure can be similar.
>
>> Probably we should set verbose mode in CI though, since it is tedious
>> to re-run CI on failure to gather more info
>>
>> > If you just want to suppress one certain warning, I think it's maybe best to
>> > fence it with "if (!qtest_enabled()) { ... }" on the QEMU side - at least
>> > that's what we did in similar cases a couple of times, IIRC.
>>
>> We're got a surprisingly large mumber of if(qtest_enabled()) conditions
>> in the code. I can't help feeling this is a bad idea in the long term,
>> as its making us take different codepaths when testing from production.
>
> What I want from CI and from tests in general:
> * if something fails, I want all the information
> * if something unexpected happens I want the warning even
> if the test passes (this is why I grep the logs for
> "warning:" in the first place -- it is to catch the case
> of "something went wrong but it didn't result in QEMU or
> the test case exiting with a failure status")
> * if something is expected, it should be silent
>
> That means there's a class of messages where we want to warn
> the user that they're doing something that might not be what
> they intended or which is deprecated and will go away soon,
> but where we do not want to "warn" in the test logging because
> the test is deliberately setting up that oddball corner case.
>
> It might be useful to have a look at where we're using
> if (qtest_enabled()) to see if we can make some subcategories
> avoid the explicit if(), e.g. by having a warn_deprecated(...)
> and hide the "don't print if qtest" inside the function.
>
I could add error/warn variants that are noop in case qtest is
enabled. It would, however, lead to this pattern which is discouraged by
the error.h documentation (+Cc Markus for advice):
before:
if (!dinfo && !qtest_enabled()) {
error_report("A flash image must be given with the "
"'pflash' parameter");
exit(1);
}
after:
if (!dinfo) {
error_report_noqtest(&error_fatal,
"A flash image must be given with the "
"'pflash' parameter");
}
For both error/warn, we'd reduce the amount of qtest_enabled() to only
the special cases not related to printing. We'd remove ~35/83 instances,
not counting the 7 printfs.
> Some categories as a starter:
> * some board models will error-and-exit if the user
> didn't provide any guest code (eg no -kernel option),
> like hw/m68k/an5206.c. When we're running with the
> qtest accelerator it's fine and expected that there's
> no guest code loaded because we'll never run any guest code
> * in some places (eg target/arm/cpu.c) we treat qtest as
> another accelerator type, so we might say
> if (tcg_enabled() || qtest_enabled()) to mean "not
> hvf or kvm"
> * sometimes we print a deprecation message only if
> not qtest, eg hw/core/numa.c or hw/core/machine.c
> * the clock related code needs to be qtest aware because
> under qtest it's the qtest protocol that advances the
> clock
> * sometimes we warn about possible user error if not
> qtest, eg hw/ppc/pnv.c or target/mips/cpu.c
>
> thanks
> -- PMM
next prev parent reply other threads:[~2024-09-06 14:42 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-05 21:03 [RFC PATCH 0/2] qtest: Log verbosity changes Fabiano Rosas
2024-09-05 21:03 ` [RFC PATCH 1/2] tests/qtest: Mute QEMU stderr Fabiano Rosas
2024-09-05 21:03 ` [RFC PATCH 2/2] tests/qtest: Mute -qtest-log Fabiano Rosas
2024-09-06 6:16 ` [RFC PATCH 0/2] qtest: Log verbosity changes Thomas Huth
2024-09-06 8:14 ` Daniel P. Berrangé
2024-09-06 9:52 ` Peter Maydell
2024-09-06 14:42 ` Fabiano Rosas [this message]
2024-09-13 10:02 ` Markus Armbruster
2024-09-13 10:08 ` Peter Maydell
2024-09-13 11:29 ` Markus Armbruster
2024-09-13 11:46 ` Peter Maydell
2024-09-13 12:14 ` Thomas Huth
2024-09-13 11:56 ` Daniel P. Berrangé
2024-09-14 9:35 ` Markus Armbruster
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=87r09wlu87.fsf@suse.de \
--to=farosas@suse.de \
--cc=armbru@redhat.com \
--cc=berrange@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=peterx@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=thuth@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.