From: Brendan Jackman <jackmanb@google.com>
To: Rae Moar <rmoar@google.com>
Cc: David Gow <davidgow@google.com>, <shuah@kernel.org>,
<linux-kselftest@vger.kernel.org>, <kunit-dev@googlegroups.com>,
<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v3 1/2] kunit: tool: Fix bug in parsing test plan
Date: Thu, 20 Mar 2025 10:07:57 +0000 [thread overview]
Message-ID: <D8L0E1Q6XSWX.2ZJ6N0FMGKEJ4@google.com> (raw)
In-Reply-To: <CA+GJov4CDitQ0w2CU46rk_zwNxU_Mn1wwGNgn-xx3uA3MwDoRg@mail.gmail.com>
On Wed Mar 19, 2025 at 9:11 PM UTC, Rae Moar wrote:
> On Mon, Mar 17, 2025 at 12:13 PM Brendan Jackman <jackmanb@google.com> wrote:
> >
> > On Fri, 14 Mar 2025 at 06:37, David Gow <davidgow@google.com> wrote:
> > >
> > > On Fri, 14 Mar 2025 at 03:27, Rae Moar <rmoar@google.com> wrote:
> > > >
> > > > A bug was identified where the KTAP below caused an infinite loop:
> > > >
> > > > TAP version 13
> > > > ok 4 test_case
> > > > 1..4
> > > >
> > > > The infinite loop was caused by the parser not parsing a test plan
> > > > if following a test result line.
> > > >
> > > > Fix this bug by parsing test plan line to avoid the infinite loop.
> >
> > Hi Rae,
> >
> > With this change and this input:
> >
> > https://gist.githubusercontent.com/bjackman/220265699f346e16161c6534b115019b/raw/a2e0e1aa75c0d8ab9814708b028ec78810a0471b/run_vmtests.sh.tap
> >
> > The infinite loop is gone, but it's still hallucinating a [CRASHED] result:
> >
> > [16:07:15] # SUMMARY: PASS=17 SKIP=0 FAIL=1
> > [16:07:15] [CRASHED]
> > ...
> > [16:07:15] Testing complete. Ran 19 tests: passed: 17, failed: 1, crashed: 1
>
> Hi! Thanks for the response. This is an interesting problem. Should a
> test plan at the bottom cause a crash because no tests were found
> after? Again with KTAP, a crash would make sense. I feel this example
> demonstrates why there is a need for a general parser that can parse
> kselftest output as well as KUnit. I'll see how difficult it would be
> to change the parser to accommodate removing the crash in a new
> version. Thanks!
Yeah, if this is difficult, it would be fine for the KUnit tool to
just say "sorry this is a KTAP parser not a general TAP parser"
With your new patch:
https://lore.kernel.org/linux-kernel/20250319223351.1517262-1-rmoar@google.com/
I get this:
[10:00:41] # SUMMARY: PASS=17 SKIP=0 FAIL=1
[10:00:41] [ERROR] Test: : No more test results!
[10:00:41] [NO TESTS RUN]
Which I think is basically fine.
We do want something that can parse this stuff properly but I tihnk
that's a separate little project.
Also, vanilla non-K TAP... is honestly a terrible format. A flat
structure for the test results (i.e. no nesting) is a bit of a joke -
even for just run_vmtests.sh which has a pretty tractable amount of
tests, it's already a pain to mentally keep track of which results
come from where. Maybe if I want to be able to parse the output of
tests I should just switch them to using KTAP.
prev parent reply other threads:[~2025-03-20 10:08 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-13 19:27 [PATCH v3 1/2] kunit: tool: Fix bug in parsing test plan Rae Moar
2025-03-13 19:27 ` [PATCH v3 2/2] kunit: tool: add test to check parsing late " Rae Moar
2025-03-14 5:37 ` David Gow
2025-03-14 5:37 ` [PATCH v3 1/2] kunit: tool: Fix bug in parsing " David Gow
2025-03-17 16:13 ` Brendan Jackman
2025-03-19 21:11 ` Rae Moar
2025-03-20 10:07 ` Brendan Jackman [this message]
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=D8L0E1Q6XSWX.2ZJ6N0FMGKEJ4@google.com \
--to=jackmanb@google.com \
--cc=davidgow@google.com \
--cc=kunit-dev@googlegroups.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=rmoar@google.com \
--cc=shuah@kernel.org \
/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