On 3/28/24 3:23 AM, Geliang Tang wrote:
From: Geliang Tang <tanggeliang@xxxxxxxxxx>
bpf_tcp_ca tests may emit EAGAIN sometimes. In that case, tests fail with
"bytes != total_bytes" errors. Sending should continue, not break when
errno is EAGAIN. This patch can make bpf_tcp_ca tests stable.
Signed-off-by: Geliang Tang <tanggeliang@xxxxxxxxxx>
---
tools/testing/selftests/bpf/prog_tests/bpf_tcp_ca.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tools/testing/selftests/bpf/prog_tests/bpf_tcp_ca.c b/tools/testing/selftests/bpf/prog_tests/bpf_tcp_ca.c
index 077b107130f6..fbc219c2d53b 100644
--- a/tools/testing/selftests/bpf/prog_tests/bpf_tcp_ca.c
+++ b/tools/testing/selftests/bpf/prog_tests/bpf_tcp_ca.c
@@ -56,7 +56,7 @@ static void *server(void *arg)
while (bytes < total_bytes && !READ_ONCE(stop)) {
nr_sent = send(fd, &batch,
MIN(total_bytes - bytes, sizeof(batch)), 0);
- if (nr_sent == -1 && errno == EINTR)
+ if (nr_sent == -1 && (errno == EINTR || errno == EAGAIN))
This is a non blocking socket. EAGAIN is hitting the timeout situation?
The default timeout is 3s and it has not been changed after the recent
connect_fd_to_fd and start_server simplifications. I don't find bpf CI failing
in this test in the last month also.
I would prefer to fail after timeout instead of keep retrying. Do you really hit
that in your environment for this specific bpf_tcp_ca test? There are many tests
using this timeout value also.