Netdev List
 help / color / mirror / Atom feed
From: Brian Grech <bgrech@redhat.com>
To: netdev@vger.kernel.org
Cc: linux-kselftest@vger.kernel.org, shuah@kernel.org,
	Brian Grech <bgrech@redhat.com>
Subject: [PATCH] selftests/net: gro: use variable sleep to handle slow environments
Date: Fri, 31 Jul 2026 09:55:45 -0500	[thread overview]
Message-ID: <20260731145545.4011291-1-bgrech@redhat.com> (raw)

The server socket initialization sleep was hardcoded at 0.5 seconds.
On slow or heavily loaded machines this is insufficient, causing the
client to connect before the server is ready and producing spurious
test failures.

Respect KSFT_MACHINE_SLOW by extending the sleep to 2 seconds when
set, consistent with how other selftests handle slow environments.

Signed-off-by: Brian Grech <bgrech@redhat.com>
---
 tools/testing/selftests/net/gro.sh | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/tools/testing/selftests/net/gro.sh b/tools/testing/selftests/net/gro.sh
index 4c5144c6f652..7c0e4434fa58 100755
--- a/tools/testing/selftests/net/gro.sh
+++ b/tools/testing/selftests/net/gro.sh
@@ -21,12 +21,14 @@ run_test() {
   # Each test is run 6 times to deflake, because given the receive timing,
   # not all packets that should coalesce will be considered in the same flow
   # on every try.
+  local sleep_time=0.5
+  [ "$KSFT_MACHINE_SLOW" = yes ] && sleep_time=2
   for tries in {1..6}; do
     # Actual test starts here
     ip netns exec $server_ns ./gro "${ARGS[@]}" "--rx" "--iface" "server" \
       1>>log.txt &
     server_pid=$!
-    sleep 0.5  # to allow for socket init
+    sleep $sleep_time  # to allow for socket init
     ip netns exec $client_ns ./gro "${ARGS[@]}" "--iface" "client" \
       1>>log.txt
     wait "${server_pid}"
-- 
2.55.0


                 reply	other threads:[~2026-07-31 14:56 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20260731145545.4011291-1-bgrech@redhat.com \
    --to=bgrech@redhat.com \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=shuah@kernel.org \
    /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