Building the Linux kernel with Clang and LLVM
 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 7/7] selftests/bpf: Skip compare_text subtest when stdout is not saved
Date: Thu, 15 Oct 2026 00:20:30 +0800	[thread overview]
Message-ID: <b6ca5327e6263cc3b6c0e381d502ce8b5570d413.camel@linux.dev> (raw)
In-Reply-To: <b66b343a0a91711a6a520e11b284941771cbb23ad8c8f1bd5f831594b567b5fa@mail.kernel.org>

On Wed, 2026-10-14 at 12:08 +0000, bot+bpf-ci@kernel.org wrote:
> > selftests/bpf: Skip compare_text subtest when stdout is not saved
> 
> TL;DR: Nit only: the new test__skip() in the compare_text_mismatch subtest
> gives no reason for skipping; a short comment or stderr message might help.
> 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 b4cd7c7ff439..ddb6cdc1579f 100644
> > --- a/tools/testing/selftests/bpf/prog_tests/prog_tests_framework.c
> > +++ b/tools/testing/selftests/bpf/prog_tests/prog_tests_framework.c
> 
> [ ... ]
> 
> > @@ -203,14 +203,18 @@ void test_prog_tests_framework_compare_text(void)
> >  	}
> > 
> >  	if (test__start_subtest("compare_text_mismatch")) {
> > -		err = compare_text_to_expected("line two\n", "line one\n");
> > -		fflush(stdout);
> > +		if (!env.subtest_state->stdout_saved) {
> > +			test__skip();
> > +		} else {
> > +			err = compare_text_to_expected("line two\n", "line one\n");
> > +			fflush(stdout);
> > 
> > -		ASSERT_EQ(err, -1, "mismatch_rc");
> > -		ASSERT_HAS_SUBSTR(env.subtest_state->log_buf, "-line one",
> > -				  "diff_has_expected");
> > -		ASSERT_HAS_SUBSTR(env.subtest_state->log_buf, "+line two",
> > -				  "diff_has_actual");
> > +			ASSERT_EQ(err, -1, "mismatch_rc");
> > +			ASSERT_HAS_SUBSTR(env.subtest_state->log_buf, "-line one",
> > +					  "diff_has_expected");
> > +			ASSERT_HAS_SUBSTR(env.subtest_state->log_buf, "+line two",
> > +					  "diff_has_actual");
> > +		}
> >  		test__end_subtest();
> >  	}
> >  }
> 
> This isn't a bug, but could the skip in the compare_text_mismatch subtest
> carry an explanation?
> 
> 	if (!env.subtest_state->stdout_saved) {
> 		test__skip();
> 	}
> 
> A subsystem guideline flags selftests that skip silently with no message,
> and test__skip() here prints nothing about why the subtest was skipped.
> The same condition covers -v in non-parallel mode, a libc without
> open_memstream() support, and an open_memstream() failure, so the reason is
> not obvious from the test output alone.
> 
> For context, the skip itself looks correct: env.subtest_state is non-NULL
> inside the subtest, test__skip() sets subtest_state->skipped, and
> test__end_subtest() handles a NULL stdout_saved.
> 
> The other skips in this file are also bare test__skip() calls, and
> test__skip() takes no reason argument, so the guideline may not map cleanly
> onto test_progs.  If a reason is wanted, would a short comment above the
> test__skip() call, or a separate message printed to env.stderr_saved, be
> appropriate?
> 
just one line for this, we can print why the test skipped. and short comment for patch#6
> 
> ---
> 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 16:20 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
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 [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=b6ca5327e6263cc3b6c0e381d502ce8b5570d413.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