* [PATCHv2 net] selftests/net/lib: update busywait timeout value
@ 2024-01-24 6:13 Hangbin Liu
2024-01-24 21:02 ` Simon Horman
2024-01-26 1:10 ` patchwork-bot+netdevbpf
0 siblings, 2 replies; 3+ messages in thread
From: Hangbin Liu @ 2024-01-24 6:13 UTC (permalink / raw)
To: netdev
Cc: David S. Miller, Jakub Kicinski, Eric Dumazet, Paolo Abeni,
Shuah Khan, David Ahern, linux-kselftest, Hangbin Liu
The busywait timeout value is a millisecond, not a second. So the
current setting 2 is too small. On slow/busy host (or VMs) the
current timeout can expire even on "correct" execution, causing random
failures. Let's copy the WAIT_TIMEOUT from forwarding/lib.sh and set
BUSYWAIT_TIMEOUT here.
Fixes: 25ae948b4478 ("selftests/net: add lib.sh")
Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
---
v2: add fixes flag. update possible failures.
---
tools/testing/selftests/net/lib.sh | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/tools/testing/selftests/net/lib.sh b/tools/testing/selftests/net/lib.sh
index dca549443801..f9fe182dfbd4 100644
--- a/tools/testing/selftests/net/lib.sh
+++ b/tools/testing/selftests/net/lib.sh
@@ -4,6 +4,9 @@
##############################################################################
# Defines
+WAIT_TIMEOUT=${WAIT_TIMEOUT:=20}
+BUSYWAIT_TIMEOUT=$((WAIT_TIMEOUT * 1000)) # ms
+
# Kselftest framework requirement - SKIP code is 4.
ksft_skip=4
# namespace list created by setup_ns
@@ -48,7 +51,7 @@ cleanup_ns()
for ns in "$@"; do
ip netns delete "${ns}" &> /dev/null
- if ! busywait 2 ip netns list \| grep -vq "^$ns$" &> /dev/null; then
+ if ! busywait $BUSYWAIT_TIMEOUT ip netns list \| grep -vq "^$ns$" &> /dev/null; then
echo "Warn: Failed to remove namespace $ns"
ret=1
fi
--
2.43.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCHv2 net] selftests/net/lib: update busywait timeout value
2024-01-24 6:13 [PATCHv2 net] selftests/net/lib: update busywait timeout value Hangbin Liu
@ 2024-01-24 21:02 ` Simon Horman
2024-01-26 1:10 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: Simon Horman @ 2024-01-24 21:02 UTC (permalink / raw)
To: Hangbin Liu
Cc: netdev, David S. Miller, Jakub Kicinski, Eric Dumazet,
Paolo Abeni, Shuah Khan, David Ahern, linux-kselftest
On Wed, Jan 24, 2024 at 02:13:44PM +0800, Hangbin Liu wrote:
> The busywait timeout value is a millisecond, not a second. So the
> current setting 2 is too small. On slow/busy host (or VMs) the
> current timeout can expire even on "correct" execution, causing random
> failures. Let's copy the WAIT_TIMEOUT from forwarding/lib.sh and set
> BUSYWAIT_TIMEOUT here.
>
> Fixes: 25ae948b4478 ("selftests/net: add lib.sh")
> Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
Reviewed-by: Simon Horman <horms@kernel.org>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCHv2 net] selftests/net/lib: update busywait timeout value
2024-01-24 6:13 [PATCHv2 net] selftests/net/lib: update busywait timeout value Hangbin Liu
2024-01-24 21:02 ` Simon Horman
@ 2024-01-26 1:10 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2024-01-26 1:10 UTC (permalink / raw)
To: Hangbin Liu
Cc: netdev, davem, kuba, edumazet, pabeni, shuah, dsahern,
linux-kselftest
Hello:
This patch was applied to netdev/net.git (main)
by Jakub Kicinski <kuba@kernel.org>:
On Wed, 24 Jan 2024 14:13:44 +0800 you wrote:
> The busywait timeout value is a millisecond, not a second. So the
> current setting 2 is too small. On slow/busy host (or VMs) the
> current timeout can expire even on "correct" execution, causing random
> failures. Let's copy the WAIT_TIMEOUT from forwarding/lib.sh and set
> BUSYWAIT_TIMEOUT here.
>
> Fixes: 25ae948b4478 ("selftests/net: add lib.sh")
> Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
>
> [...]
Here is the summary with links:
- [PATCHv2,net] selftests/net/lib: update busywait timeout value
https://git.kernel.org/netdev/net/c/fc836129f708
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-01-26 1:10 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-24 6:13 [PATCHv2 net] selftests/net/lib: update busywait timeout value Hangbin Liu
2024-01-24 21:02 ` Simon Horman
2024-01-26 1:10 ` patchwork-bot+netdevbpf
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).