diff mbox series

[net] selftests: net: bridge: increase IGMP/MLD exclude timeout membership interval

Message ID 20240513105257.769303-1-razor@blackwall.org (mailing list archive)
State Accepted
Commit 06080ea23095afe04a2cb7a8d05fab4311782623
Delegated to: Netdev Maintainers
Headers show
Series [net] selftests: net: bridge: increase IGMP/MLD exclude timeout membership interval | expand

Checks

Context Check Description
netdev/series_format success Single patches do not need cover letters
netdev/tree_selection success Clearly marked for net
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag present in non-next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 8 this patch: 8
netdev/build_tools success Errors and warnings before: 0 this patch: 0
netdev/cc_maintainers warning 2 maintainers not CCed: linux-kselftest@vger.kernel.org shuah@kernel.org
netdev/build_clang success Errors and warnings before: 8 this patch: 8
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success net selftest script(s) already in Makefile
netdev/verify_fixes success Fixes tag looks correct
netdev/build_allmodconfig_warn success Errors and warnings before: 8 this patch: 8
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 40 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
netdev/contest success net-next-2024-05-14--00-00 (tests: 1022)

Commit Message

Nikolay Aleksandrov May 13, 2024, 10:52 a.m. UTC
When running the bridge IGMP/MLD selftests on debug kernels we can get
spurious errors when setting up the IGMP/MLD exclude timeout tests
because the membership interval is just 3 seconds and the setup has 2
seconds of sleep plus various validations, the one second that is left
is not enough. Increase the membership interval from 3 to 5 seconds to
make room for the setup validation and 2 seconds of sleep.

Fixes: 34d7ecb3d4f7 ("selftests: net: bridge: update IGMP/MLD membership interval value")
Reported-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Nikolay Aleksandrov <razor@blackwall.org>
---
Could you please validate this fixes the flakes for the netdev CI?
It fixed them for me with the CI's debug kernel config. :)

 tools/testing/selftests/net/forwarding/bridge_igmp.sh | 6 +++---
 tools/testing/selftests/net/forwarding/bridge_mld.sh  | 6 +++---
 2 files changed, 6 insertions(+), 6 deletions(-)

Comments

Hangbin Liu May 14, 2024, 12:42 a.m. UTC | #1
On Mon, May 13, 2024 at 01:52:57PM +0300, Nikolay Aleksandrov wrote:
>  	$MZ $h1 -c 1 -b $ALL_MAC -B $ALL_GROUP -t ip "proto=2,p=$MZPKT_ALLOW2" -q
> -	sleep 3
> +	sleep 5
>  	bridge -j -d -s mdb show dev br0 \
>  		| jq -e ".[].mdb[] | \
>  			 select(.grp == \"$TEST_GROUP\" and \
> diff --git a/tools/testing/selftests/net/forwarding/bridge_mld.sh b/tools/testing/selftests/net/forwarding/bridge_mld.sh
> index e2b9ff773c6b..f84ab2e65754 100755
> --- a/tools/testing/selftests/net/forwarding/bridge_mld.sh
> +++ b/tools/testing/selftests/net/forwarding/bridge_mld.sh
>  
>  	$MZ $h1 -c 1 $MZPKT_ALLOW2 -q
> -	sleep 3
> +	sleep 5
>  	bridge -j -d -s mdb show dev br0 \
>  		| jq -e ".[].mdb[] | \
>  			 select(.grp == \"$TEST_GROUP\" and \

Maybe use a slow_wait to check the result?

Thanks
Hangbin
Nikolay Aleksandrov May 14, 2024, 7:46 a.m. UTC | #2
On 14/05/2024 03:42, Hangbin Liu wrote:
> On Mon, May 13, 2024 at 01:52:57PM +0300, Nikolay Aleksandrov wrote:
>>  	$MZ $h1 -c 1 -b $ALL_MAC -B $ALL_GROUP -t ip "proto=2,p=$MZPKT_ALLOW2" -q
>> -	sleep 3
>> +	sleep 5
>>  	bridge -j -d -s mdb show dev br0 \
>>  		| jq -e ".[].mdb[] | \
>>  			 select(.grp == \"$TEST_GROUP\" and \
>> diff --git a/tools/testing/selftests/net/forwarding/bridge_mld.sh b/tools/testing/selftests/net/forwarding/bridge_mld.sh
>> index e2b9ff773c6b..f84ab2e65754 100755
>> --- a/tools/testing/selftests/net/forwarding/bridge_mld.sh
>> +++ b/tools/testing/selftests/net/forwarding/bridge_mld.sh
>>  
>>  	$MZ $h1 -c 1 $MZPKT_ALLOW2 -q
>> -	sleep 3
>> +	sleep 5
>>  	bridge -j -d -s mdb show dev br0 \
>>  		| jq -e ".[].mdb[] | \
>>  			 select(.grp == \"$TEST_GROUP\" and \
> 
> Maybe use a slow_wait to check the result?
> 
> Thanks
> Hangbin

What would it improve? The wait is exact, we know how many seconds
exactly so a plain sleep is enough and easier to backport if this
is applied to -net.
Hangbin Liu May 14, 2024, 12:18 p.m. UTC | #3
On Tue, May 14, 2024 at 10:46:15AM +0300, Nikolay Aleksandrov wrote:
> >> diff --git a/tools/testing/selftests/net/forwarding/bridge_mld.sh b/tools/testing/selftests/net/forwarding/bridge_mld.sh
> >> index e2b9ff773c6b..f84ab2e65754 100755
> >> --- a/tools/testing/selftests/net/forwarding/bridge_mld.sh
> >> +++ b/tools/testing/selftests/net/forwarding/bridge_mld.sh
> >>  
> >>  	$MZ $h1 -c 1 $MZPKT_ALLOW2 -q
> >> -	sleep 3
> >> +	sleep 5
> >>  	bridge -j -d -s mdb show dev br0 \
> >>  		| jq -e ".[].mdb[] | \
> >>  			 select(.grp == \"$TEST_GROUP\" and \
> > 
> > Maybe use a slow_wait to check the result?
> > 
> > Thanks
> > Hangbin
> 
> What would it improve? The wait is exact, we know how many seconds
> exactly so a plain sleep is enough and easier to backport if this
> is applied to -net.

I just afraid it fails on debug kernel with this exact time. If you think
the time is enough. I'm OK with it.

Thanks
Hangbin
patchwork-bot+netdevbpf@kernel.org May 15, 2024, 10:50 a.m. UTC | #4
Hello:

This patch was applied to netdev/net.git (main)
by David S. Miller <davem@davemloft.net>:

On Mon, 13 May 2024 13:52:57 +0300 you wrote:
> When running the bridge IGMP/MLD selftests on debug kernels we can get
> spurious errors when setting up the IGMP/MLD exclude timeout tests
> because the membership interval is just 3 seconds and the setup has 2
> seconds of sleep plus various validations, the one second that is left
> is not enough. Increase the membership interval from 3 to 5 seconds to
> make room for the setup validation and 2 seconds of sleep.
> 
> [...]

Here is the summary with links:
  - [net] selftests: net: bridge: increase IGMP/MLD exclude timeout membership interval
    https://git.kernel.org/netdev/net/c/06080ea23095

You are awesome, thank you!
diff mbox series

Patch

diff --git a/tools/testing/selftests/net/forwarding/bridge_igmp.sh b/tools/testing/selftests/net/forwarding/bridge_igmp.sh
index 2aa66d2a1702..e6a3e04fd83f 100755
--- a/tools/testing/selftests/net/forwarding/bridge_igmp.sh
+++ b/tools/testing/selftests/net/forwarding/bridge_igmp.sh
@@ -478,10 +478,10 @@  v3exc_timeout_test()
 	RET=0
 	local X=("192.0.2.20" "192.0.2.30")
 
-	# GMI should be 3 seconds
+	# GMI should be 5 seconds
 	ip link set dev br0 type bridge mcast_query_interval 100 \
 					mcast_query_response_interval 100 \
-					mcast_membership_interval 300
+					mcast_membership_interval 500
 
 	v3exclude_prepare $h1 $ALL_MAC $ALL_GROUP
 	ip link set dev br0 type bridge mcast_query_interval 500 \
@@ -489,7 +489,7 @@  v3exc_timeout_test()
 					mcast_membership_interval 1500
 
 	$MZ $h1 -c 1 -b $ALL_MAC -B $ALL_GROUP -t ip "proto=2,p=$MZPKT_ALLOW2" -q
-	sleep 3
+	sleep 5
 	bridge -j -d -s mdb show dev br0 \
 		| jq -e ".[].mdb[] | \
 			 select(.grp == \"$TEST_GROUP\" and \
diff --git a/tools/testing/selftests/net/forwarding/bridge_mld.sh b/tools/testing/selftests/net/forwarding/bridge_mld.sh
index e2b9ff773c6b..f84ab2e65754 100755
--- a/tools/testing/selftests/net/forwarding/bridge_mld.sh
+++ b/tools/testing/selftests/net/forwarding/bridge_mld.sh
@@ -478,10 +478,10 @@  mldv2exc_timeout_test()
 	RET=0
 	local X=("2001:db8:1::20" "2001:db8:1::30")
 
-	# GMI should be 3 seconds
+	# GMI should be 5 seconds
 	ip link set dev br0 type bridge mcast_query_interval 100 \
 					mcast_query_response_interval 100 \
-					mcast_membership_interval 300
+					mcast_membership_interval 500
 
 	mldv2exclude_prepare $h1
 	ip link set dev br0 type bridge mcast_query_interval 500 \
@@ -489,7 +489,7 @@  mldv2exc_timeout_test()
 					mcast_membership_interval 1500
 
 	$MZ $h1 -c 1 $MZPKT_ALLOW2 -q
-	sleep 3
+	sleep 5
 	bridge -j -d -s mdb show dev br0 \
 		| jq -e ".[].mdb[] | \
 			 select(.grp == \"$TEST_GROUP\" and \