mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-02 23:27:06 +00:00
selftests: mptcp: userspace pm: uniform verify events
commit711ae788cb
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:6c73008aa3
("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>
This commit is contained in:
parent
9513583551
commit
a096a78d70
1 changed files with 2 additions and 0 deletions
|
@ -884,6 +884,7 @@ test_listener()
|
|||
$client4_port > /dev/null 2>&1 &
|
||||
local listener_pid=$!
|
||||
|
||||
sleep 0.5
|
||||
verify_listener_events $client_evts $LISTENER_CREATED $AF_INET 10.0.2.2 $client4_port
|
||||
|
||||
# ADD_ADDR from client to server machine reusing the subflow port
|
||||
|
@ -899,6 +900,7 @@ test_listener()
|
|||
# Delete the listener from the client ns, if one was created
|
||||
kill_wait $listener_pid
|
||||
|
||||
sleep 0.5
|
||||
verify_listener_events $client_evts $LISTENER_CLOSED $AF_INET 10.0.2.2 $client4_port
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue