Subject: Re: [PATCHv3 net-next 4/4] selftests: bonding: use slowwait instead of hard code sleep

From: Jakub Kicinski <[email-masked]>
Date: Sat, 3 Feb 2024 09:41:51 -0800

On Fri,  2 Feb 2024 10:37:54 +0800 Hangbin Liu wrote:
> diff --git a/tools/testing/selftests/drivers/net/bonding/bond_macvlan.sh b/tools/testing/selftests/drivers/net/bonding/bond_macvlan.sh
> index b609fb6231f4..acd3ebed3e20 100755
> --- a/tools/testing/selftests/drivers/net/bonding/bond_macvlan.sh
> +++ b/tools/testing/selftests/drivers/net/bonding/bond_macvlan.sh
> @@ -58,7 +58,7 @@ macvlan_over_bond()
>  	ip -n ${m2_ns} addr add ${m2_ip4}/24 dev macv0
>  	ip -n ${m2_ns} addr add ${m2_ip6}/24 dev macv0
>  
> -	sleep 2
> +	slowwait 2 ip netns exec ${c_ns} ping ${s_ip4} -c 1 -W 0.1 &> /dev/null
>  
>  	check_connection "${c_ns}" "${s_ip4}" "IPv4: client->server"
>  	check_connection "${c_ns}" "${s_ip6}" "IPv6: client->server"
> @@ -69,8 +69,7 @@ macvlan_over_bond()
>  	check_connection "${m1_ns}" "${m2_ip4}" "IPv4: macvlan_1->macvlan_2"
>  	check_connection "${m1_ns}" "${m2_ip6}" "IPv6: macvlan_1->macvlan_2"
>  
> -
> -	sleep 5
> +	slowwait 5 ip netns exec ${s_ns} ping ${c_ip4} -c 1 -W 0.1 &> /dev/null
>  
>  	check_connection "${s_ns}" "${c_ip4}" "IPv4: server->client"
>  	check_connection "${s_ns}" "${c_ip6}" "IPv6: server->client"

This makes the bond_macvlan.sh test flaky:

https://netdev.bots.linux.dev/contest.html?test=bond-macvlan-sh

I repro'd it and the ping in check_connection() fails - neigh resolution
fails. I guess we need to insert more of the slowwaits?

Reverting this patch from the pending patch tree fixes it. The runner
has no KVM support, and runs a VM with 64 CPUs. If I lower the number
of CPUs to 4 the test passes. I added the note that some flakiness may
be caused by high CPU count:

https://github.com/linux-netdev/nipa/wiki/How-to-run-netdev-selftests-CI-style#tips
-- 
pw-bot: cr