Re: [PATCH 1/2] tests/sctp: fix a race condition in the new ASCONF test

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 2020-10-21 at 23:44 +0200, Ondrej Mosnacek wrote:
> The new ASCONF test introduced recently (see Fixes: tag) is unstable
> and
> can randomly fail on slow machines. The problem seems to be triggered
> when the server does the sctp_bindx() calls before the client starts
> listening for a new message, so add a 1 second sleep before the bindx
> calls.
> 
> It is possible that this delay will not be enough on some very slow
> machines, but let's start with a small value and see how it goes. The
> one second seems to be enough for the Travis CI at least.
> 
> Fixes: 841ccaabb366 ("selinux-testsuite: Update SCTP asconf
> client/server")
> Signed-off-by: Ondrej Mosnacek <omosnace@xxxxxxxxxx>
> ---
>  tests/sctp/sctp_asconf_params_server.c | 7 +++++++
>  1 file changed, 7 insertions(+)

Tested the three asconf tests over 1000 interations with no problems.
In the meantime I'll review these tests to find a more reliable way to
run them.

Acked-by: Richard Haines <richard_c_haines@xxxxxxxxxxxxxx>
> 
> diff --git a/tests/sctp/sctp_asconf_params_server.c
> b/tests/sctp/sctp_asconf_params_server.c
> index 18e2cb2..ded782e 100644
> --- a/tests/sctp/sctp_asconf_params_server.c
> +++ b/tests/sctp/sctp_asconf_params_server.c
> @@ -225,6 +225,13 @@ int main(int argc, char **argv)
>  		       ((struct sockaddr_in6 *)
>  			new_pri_addr_res->ai_addr)->sin6_scope_id);
>  
> +	/*
> +	 * We can't do the sctp_bindx() calls too fast, otherwise the
> test
> +	 * that checks if these are denied would fail. Therefore, sleep
> for
> +	 * a bit to allow the client to catch up.
> +	 */
> +	sleep(1);
> +
>  	/*
>  	 * Now call sctp_bindx(3) to add 'new_pri_addr'. This uses
> Dynamic
>  	 * Address Reconfiguration by sending an asconf chunk with




[Index of Archives]     [Selinux Refpolicy]     [Linux SGX]     [Fedora Users]     [Fedora Desktop]     [Yosemite Photos]     [Yosemite Camping]     [Yosemite Campsites]     [KDE Users]     [Gnome Users]

  Powered by Linux