selftests: mptcp: more stable simult_flows tests
authorPaolo Abeni <pabeni@redhat.com>
Fri, 29 Oct 2021 23:55:59 +0000 (16:55 -0700)
committerDavid S. Miller <davem@davemloft.net>
Mon, 1 Nov 2021 13:19:49 +0000 (13:19 +0000)
commitb6ab64b074f29b42ff272793806efc913f7cc742
tree53a30c8b92996cda2fbd6843b9e3e29bfd85c0ad
parent7c909a98042ce403c8497c5d6ff94dd53bdd2131
selftests: mptcp: more stable simult_flows tests

Currently the simult_flows.sh self-tests are not very stable,
especially when running on slow VMs.

The tests measure runtime for transfers on multiple subflows
and check that the time is near the theoretical maximum.

The current test infra introduces a bit of jitter in test
runtime, due to multiple explicit delays. Additionally the
runtime is measured by the shell script wrapper. On a slow
VM, the script overhead is measurable and subject to relevant
jitter.

One solution to make the test more stable would be adding more
slack to the expected time; that could possibly hide real
regressions. Instead move the measurement inside the command
doing the transfer, and drop most unneeded sleeps.

Reviewed-by: Matthieu Baerts <matthieu.baerts@tessares.net>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Mat Martineau <mathew.j.martineau@linux.intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
tools/testing/selftests/net/mptcp/mptcp_connect.c
tools/testing/selftests/net/mptcp/simult_flows.sh