Linux Kernel Selftest development
 help / color / mirror / Atom feed
From: KaFai Wan <kafai.wan@linux.dev>
To: bot+bpf-ci@kernel.org, ast@kernel.org, daniel@iogearbox.net,
	 john.fastabend@gmail.com, andrii@kernel.org, eddyz87@gmail.com,
	memxor@gmail.com,  martin.lau@linux.dev, song@kernel.org,
	yonghong.song@linux.dev, jolsa@kernel.org,  emil@etsalapatis.com,
	ihor.solodrai@linux.dev, shuah@kernel.org, nathan@kernel.org,
	 ndesaulniers@google.com, morbo@google.com,
	justinstitt@google.com,  donggeunyoo.kernel@gmail.com,
	leon.hwang@linux.dev, menglong8.dong@gmail.com,
	 yatsenko@meta.com, jiangfeng@kylinos.cn, bjorn@kernel.org,
	puranjay@kernel.org,  vineet.gupta@linux.dev, mykolal@fb.com,
	bpf@vger.kernel.org,  linux-kernel@vger.kernel.org,
	linux-kselftest@vger.kernel.org,  llvm@lists.linux.dev
Cc: martin.lau@kernel.org, mason@kernel.org
Subject: Re: [PATCH bpf-next v2 6/7] selftests/bpf: Skip expected_msgs subtests when stdout is not saved
Date: Wed, 14 Oct 2026 23:41:30 +0800	[thread overview]
Message-ID: <0db65f50adf251e210b6fdda44b5706f641ef4fe.camel@linux.dev> (raw)
In-Reply-To: <7b00556c5b846e17d2f940c8b007b64b37dc24219d9c0a31ebbfbedb02f74ea3@mail.kernel.org>

On Wed, 2026-10-14 at 12:08 +0000, bot+bpf-ci@kernel.org wrote:
> > selftests/bpf: Skip expected_msgs subtests when stdout is not saved
> 
> TL;DR: Nit only: the new test__skip() in the expected_msgs selftest is silent,
> so -v output doesn't say why subtests were skipped; the review asks whether to
> print a short reason. The skip logic itself looks correct.
> 
> > diff --git a/tools/testing/selftests/bpf/prog_tests/prog_tests_framework.c
> > b/tools/testing/selftests/bpf/prog_tests/prog_tests_framework.c
> > index 53347f379924..b4cd7c7ff439 100644
> > --- a/tools/testing/selftests/bpf/prog_tests/prog_tests_framework.c
> > +++ b/tools/testing/selftests/bpf/prog_tests/prog_tests_framework.c
> 
> [ ... ]
> 
> > @@ -169,6 +169,12 @@ void test_prog_tests_framework_expected_msgs(void)
> > 
> >  	for (i = 0; i < ARRAY_SIZE(cases); i++) {
> >  		if (test__start_subtest(cases[i].name)) {
> > +			if (!env.subtest_state->stdout_saved) {
> > +				test__skip();
> > +				test__end_subtest();
> > +				continue;
> > +			}
> > +
> 
> This isn't a bug, but a subsystem guideline flags a test__skip() that is
> issued silently, with no message.
> 
> test__skip() here is called without any explanation, so a -v run only shows
> the generic "#N/M <subtest>:SKIP" line from test__end_subtest().  Someone
> reading that output has to look at the code or the commit message to learn
> the subtests were skipped because stdout is not captured in non-parallel
> verbose mode.
> 
> The skip itself looks correct, since stdio_hijack_init() returns early when
> verbose() && env.worker_id == -1 and leaves subtest_state->stdout_saved and
> log_buf unset.  test__skip() takes no reason argument, and many other
> test__skip() callers in prog_tests are also bare.
> 
> Would it be worth printing a short reason before test__skip(), for example:
> 
>     fprintf(stderr, "SKIP: stdout is not saved in non-parallel verbose mode\n");

I don't think we need this. for two reasons:
a) -v is mainly used for debugging, showing details; this is a test for the framework, not the real
bpf test, all tests should pass, no need to debug;
b) this is a loop. if we keep adding this message, it could repeat for 9 lines.
> 
> >  			error_cnt = env.subtest_state->error_cnt;
> >  			msgs.patterns = cases[i].pats;
> >  			msgs.cnt = 0;
> 
> 
> ---
> AI reviewed your patch. Please fix the bug or email reply why it's not a bug.
> See: https://github.com/kernel-patches/vmtest/blob/master/ci/claude/README.md
> 
> CI run summary: https://github.com/kernel-patches/bpf/actions/runs/38559567568

-- 
Thanks,
KaFai

  reply	other threads:[~2026-10-14 15:41 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-14 11:30 [PATCH bpf-next v2 0/7] selftests/bpf: Fix selftests failures with LLVM 23 KaFai Wan
2026-10-14 11:30 ` [PATCH bpf-next v2 1/7] bpf: Determine freplace staticness from BTF linkage KaFai Wan
2026-10-14 11:30 ` [PATCH bpf-next v2 2/7] selftests/bpf: Fix stack_arg precision backtracking log expectation KaFai Wan
2026-10-14 11:30 ` [PATCH bpf-next v2 3/7] selftests/bpf: Fix stack arg pruning test JOIN " KaFai Wan
2026-10-14 11:30 ` [PATCH bpf-next v2 4/7] selftests/bpf: Use _exit() in uprobe_multi_test clone-ed child KaFai Wan
2026-10-14 11:30 ` [PATCH bpf-next v2 5/7] selftests/bpf: Fix prog_tests framework subtest count checks KaFai Wan
2026-10-14 11:30 ` [PATCH bpf-next v2 6/7] selftests/bpf: Skip expected_msgs subtests when stdout is not saved KaFai Wan
2026-10-14 12:08   ` bot+bpf-ci
2026-10-14 15:41     ` KaFai Wan [this message]
2026-10-14 11:30 ` [PATCH bpf-next v2 7/7] selftests/bpf: Skip compare_text subtest " KaFai Wan
2026-10-14 12:08   ` bot+bpf-ci
2026-10-14 16:20     ` KaFai Wan

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=0db65f50adf251e210b6fdda44b5706f641ef4fe.camel@linux.dev \
    --to=kafai.wan@linux.dev \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bjorn@kernel.org \
    --cc=bot+bpf-ci@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=donggeunyoo.kernel@gmail.com \
    --cc=eddyz87@gmail.com \
    --cc=emil@etsalapatis.com \
    --cc=ihor.solodrai@linux.dev \
    --cc=jiangfeng@kylinos.cn \
    --cc=john.fastabend@gmail.com \
    --cc=jolsa@kernel.org \
    --cc=justinstitt@google.com \
    --cc=leon.hwang@linux.dev \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=llvm@lists.linux.dev \
    --cc=martin.lau@kernel.org \
    --cc=martin.lau@linux.dev \
    --cc=mason@kernel.org \
    --cc=memxor@gmail.com \
    --cc=menglong8.dong@gmail.com \
    --cc=morbo@google.com \
    --cc=mykolal@fb.com \
    --cc=nathan@kernel.org \
    --cc=ndesaulniers@google.com \
    --cc=puranjay@kernel.org \
    --cc=shuah@kernel.org \
    --cc=song@kernel.org \
    --cc=vineet.gupta@linux.dev \
    --cc=yatsenko@meta.com \
    --cc=yonghong.song@linux.dev \
    /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