bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alexei Starovoitov <alexei.starovoitov@gmail.com>
To: Yucong Sun <fallentree@fb.com>
Cc: Andrii Nakryiko <andrii@kernel.org>,
	sunyucong@gmail.com, bpf <bpf@vger.kernel.org>
Subject: Re: [PATCH bpf-next] selftests/bpf: reduce more flakyness in sockmap_listen
Date: Wed, 25 Aug 2021 18:04:43 -0700	[thread overview]
Message-ID: <CAADnVQJz8LUTsm_azd4JE0n5Q4Me0Lze6hmsqNYfAKMeA44_fQ@mail.gmail.com> (raw)
In-Reply-To: <20210825184745.2680830-1-fallentree@fb.com>

On Wed, Aug 25, 2021 at 2:07 PM Yucong Sun <fallentree@fb.com> wrote:
>
> This patch adds similar retry logic to more places where read() is used, to
> reduce flakyness in slow CI environment.
>
> Signed-off-by: Yucong Sun <fallentree@fb.com>
> ---
>  .../selftests/bpf/prog_tests/sockmap_listen.c | 19 ++++++++++++++++---
>  1 file changed, 16 insertions(+), 3 deletions(-)
>
> diff --git a/tools/testing/selftests/bpf/prog_tests/sockmap_listen.c b/tools/testing/selftests/bpf/prog_tests/sockmap_listen.c
> index 6a5df28f9a3d..5c5979046523 100644
> --- a/tools/testing/selftests/bpf/prog_tests/sockmap_listen.c
> +++ b/tools/testing/selftests/bpf/prog_tests/sockmap_listen.c
> @@ -949,6 +949,7 @@ static void redir_to_connected(int family, int sotype, int sock_mapfd,
>         int err, n;
>         u32 key;
>         char b;
> +       int retries = 100;
>
>         zero_verdict_count(verd_mapfd);
>
> @@ -1001,10 +1002,15 @@ static void redir_to_connected(int family, int sotype, int sock_mapfd,
>                 goto close_peer1;
>         if (pass != 1)
>                 FAIL("%s: want pass count 1, have %d", log_prefix, pass);
> -
> +again:
>         n = read(c0, &b, 1);
> -       if (n < 0)
> +       if (n < 0) {
> +               if (errno == EAGAIN && retries--) {

TCP was fixed differently in
commit 30b4cb36b111 ("selftests/bpf: Fix spurious failures in accept
due to EAGAIN").
Would a similar approach work here?

  reply	other threads:[~2021-08-26  1:04 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-25 18:47 [PATCH bpf-next] selftests/bpf: reduce more flakyness in sockmap_listen Yucong Sun
2021-08-26  1:04 ` Alexei Starovoitov [this message]
2021-08-26  2:37   ` sunyucong
2021-08-26 18:18     ` sunyucong
2021-08-26 19:07       ` Alexei Starovoitov
2021-08-26 19:23         ` sunyucong
2021-08-26 21:05           ` Alexei Starovoitov
2021-08-26 21:07             ` sunyucong
2021-08-31 19:33         ` Cong Wang
2021-09-02  1:33           ` Cong Wang
2021-09-02  3:34             ` sunyucong
2021-09-03 23:44               ` Cong Wang
2021-09-07  2:24                 ` sunyucong
2021-09-15 14:13                   ` sunyucong
2021-09-15 16:54                   ` Cong Wang

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=CAADnVQJz8LUTsm_azd4JE0n5Q4Me0Lze6hmsqNYfAKMeA44_fQ@mail.gmail.com \
    --to=alexei.starovoitov@gmail.com \
    --cc=andrii@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=fallentree@fb.com \
    --cc=sunyucong@gmail.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;
as well as URLs for NNTP newsgroup(s).