BPF List
 help / color / mirror / Atom feed
From: Yonghong Song <yonghong.song@linux.dev>
To: YiFei Zhu <zhuyifei@google.com>, bpf@vger.kernel.org
Cc: Alexei Starovoitov <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Stanislav Fomichev <sdf@google.com>,
	Martin KaFai Lau <martin.lau@linux.dev>,
	Andrii Nakryiko <andrii@kernel.org>,
	Song Liu <songliubraving@fb.com>,
	Kurt Kanzenbach <kurt@linutronix.de>
Subject: Re: [PATCH bpf] selftests/bpf: Relax time_tai test for equal timestamps in tai_forward
Date: Tue, 12 Dec 2023 13:39:26 -0800	[thread overview]
Message-ID: <bff66df3-bd32-445a-89a8-b6208d87ae0c@linux.dev> (raw)
In-Reply-To: <20231212182911.3784108-1-zhuyifei@google.com>


On 12/12/23 10:29 AM, YiFei Zhu wrote:
> We're observing test flakiness on an arm64 platform which might not
> have timestamps as precise as x86. The test log looks like:
>
>    test_time_tai:PASS:tai_open 0 nsec
>    test_time_tai:PASS:test_run 0 nsec
>    test_time_tai:PASS:tai_ts1 0 nsec
>    test_time_tai:PASS:tai_ts2 0 nsec
>    test_time_tai:FAIL:tai_forward unexpected tai_forward: actual 1702348135471494160 <= expected 1702348135471494160
>    test_time_tai:PASS:tai_gettime 0 nsec
>    test_time_tai:PASS:tai_future_ts1 0 nsec
>    test_time_tai:PASS:tai_future_ts2 0 nsec
>    test_time_tai:PASS:tai_range_ts1 0 nsec
>    test_time_tai:PASS:tai_range_ts2 0 nsec
>    #199     time_tai:FAIL
>
> This patch changes ASSERT_GT to ASSERT_GE in the tai_forward assertion
> so that equal timestamps are permitted.
>
> Fixes: 64e15820b987 ("selftests/bpf: Add BPF-helper test for CLOCK_TAI access")
> Signed-off-by: YiFei Zhu <zhuyifei@google.com>
> ---
>   tools/testing/selftests/bpf/prog_tests/time_tai.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/testing/selftests/bpf/prog_tests/time_tai.c b/tools/testing/selftests/bpf/prog_tests/time_tai.c
> index a31119823666..f45af1b0ef2c 100644
> --- a/tools/testing/selftests/bpf/prog_tests/time_tai.c
> +++ b/tools/testing/selftests/bpf/prog_tests/time_tai.c
> @@ -56,7 +56,7 @@ void test_time_tai(void)
>   	ASSERT_NEQ(ts2, 0, "tai_ts2");
>   
>   	/* TAI is moving forward only */
> -	ASSERT_GT(ts2, ts1, "tai_forward");
> +	ASSERT_GE(ts2, ts1, "tai_forward");

Can we guard the new change with arm64 specific macro?

>   
>   	/* Check for future */
>   	ret = clock_gettime(CLOCK_TAI, &now_tai);

  reply	other threads:[~2023-12-12 21:39 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-12 18:29 [PATCH bpf] selftests/bpf: Relax time_tai test for equal timestamps in tai_forward YiFei Zhu
2023-12-12 21:39 ` Yonghong Song [this message]
2023-12-12 21:52   ` YiFei Zhu
2023-12-13  0:01     ` Andrii Nakryiko
2023-12-19  9:57     ` Kurt Kanzenbach
2023-12-13  0:00 ` patchwork-bot+netdevbpf

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=bff66df3-bd32-445a-89a8-b6208d87ae0c@linux.dev \
    --to=yonghong.song@linux.dev \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=kurt@linutronix.de \
    --cc=martin.lau@linux.dev \
    --cc=sdf@google.com \
    --cc=songliubraving@fb.com \
    --cc=zhuyifei@google.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