]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commit
selftests: mptcp: userspace pm: uniform verify events
authorMatthieu Baerts <matthieu.baerts@tessares.net>
Tue, 11 Apr 2023 20:42:12 +0000 (22:42 +0200)
committerRoxana Nicolescu <roxana.nicolescu@canonical.com>
Wed, 17 May 2023 11:34:15 +0000 (13:34 +0200)
commit2e7528e6f4eb7f9ceb85b4b4f05cd2f1695be587
tree2bd25eb055d46166c096ff9d8926e236b821bfe1
parent376131b7f05ad07248da5c6c03bfdfe48b6b2e5f
selftests: mptcp: userspace pm: uniform verify events

BugLink: https://bugs.launchpad.net/bugs/2017219
commit 711ae788cbbb82818531b55e32b09518ee09a11a upstream.

Simply adding a "sleep" before checking something is usually not a good
idea because the time that has been picked can not be enough or too
much. The best is to wait for events with a timeout.

In this selftest, 'sleep 0.5' is used more than 40 times. It is always
used before calling a 'verify_*' function except for this
verify_listener_events which has been added later.

At the end, using all these 'sleep 0.5' seems to work: the slow CIs
don't complain so far. Also because it doesn't take too much time, we
can just add two more 'sleep 0.5' to uniform what is done before calling
a 'verify_*' function. For the same reasons, we can also delay a bigger
refactoring to replace all these 'sleep 0.5' by functions waiting for
events instead of waiting for a fix time and hope for the best.

Fixes: 6c73008aa301 ("selftests: mptcp: listener test for userspace PM")
Cc: stable@vger.kernel.org
Suggested-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Matthieu Baerts <matthieu.baerts@tessares.net>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
tools/testing/selftests/net/mptcp/userspace_pm.sh