Message ID | 20201021214453.400811-2-omosnace@redhat.com (mailing list archive) |
---|---|
State | Accepted |
Delegated to: | Ondrej Mosnáček |
Headers | show |
Series | Fix ASCONF test and ensure it can be always run | expand |
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@redhat.com> > --- > 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@btinternet.com> > > 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
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
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@redhat.com> --- tests/sctp/sctp_asconf_params_server.c | 7 +++++++ 1 file changed, 7 insertions(+)