selftests: net: avoid just another constant wait
authorPaolo Abeni <pabeni@redhat.com>
Thu, 1 Feb 2024 18:42:41 +0000 (19:42 +0100)
committerJakub Kicinski <kuba@kernel.org>
Sat, 3 Feb 2024 05:11:21 +0000 (21:11 -0800)
commit691bb4e49c98a47bc643dd808453136ce78b15b4
tree5d6fcb3b9c6ba88fc7268e689ad1939927e0570c
parente71e016ad0f6e641a7898b8cda5f62f8e2beb2f1
selftests: net: avoid just another constant wait

Using hard-coded constant timeout to wait for some expected
event is deemed to fail sooner or later, especially in slow
env.

Our CI has spotted another of such race:
   # TEST: ipv6: cleanup of cached exceptions - nexthop objects          [FAIL]
   #   can't delete veth device in a timely manner, PMTU dst likely leaked

Replace the crude sleep with a loop looking for the expected condition
at low interval for a much longer range.

Fixes: b3cc4f8a8a41 ("selftests: pmtu: add explicit tests for PMTU exceptions cleanup")
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Reviewed-by: David Ahern <dsahern@kernel.org>
Link: https://lore.kernel.org/r/fd5c745e9bb665b724473af6a9373a8c2a62b247.1706812005.git.pabeni@redhat.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
tools/testing/selftests/net/pmtu.sh