Skip to content

Commit 6e15774

Browse files
committed
Merge branch 'selftests-mptcp-mark-unstable-subtests-as-flaky'
Matthieu Baerts says: ==================== selftests: mptcp: mark unstable subtests as flaky Some subtests can be unstable, failing once every X runs. Fixing them can take time: there could be an issue in the kernel or in the subtest, and it is then important to do a proper analysis, not to hide real bugs. To avoid creating noises on the different CIs where tests are more unstable than on our side, some subtests have been marked as flaky. As a result, errors with these subtests (if any) are ignored. Note that the MPTCP CI will continue to track these flaky subtests. All these unstable subtests are also tracked by our bug tracker. These are fixes for the -net tree, because the instabilities are visible there. The first patch introducing the flake support has no 'Fixes' tags, mainly because it requires recent and important refactoring done in all MPTCP selftests. Backporting that to old versions where the flaky tests have been introduced would be too difficult, and probably not worth it. The other patches, adding MPTCP_LIB_SUBTEST_FLAKY=1, have a Fixes tag, simply to ease the backport of the future fixes removing them along with the proper fix. ==================== Link: https://lore.kernel.org/r/20240524-upstream-net-20240524-selftests-mptcp-flaky-v1-0-a352362f3f8e@kernel.org Signed-off-by: Jakub Kicinski <[email protected]>
2 parents 7a8cc96 + 38af56e commit 6e15774

File tree

3 files changed

+40
-6
lines changed

3 files changed

+40
-6
lines changed

tools/testing/selftests/net/mptcp/mptcp_join.sh

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,8 @@ reset()
261261

262262
TEST_NAME="${1}"
263263

264+
MPTCP_LIB_SUBTEST_FLAKY=0 # reset if modified
265+
264266
if skip_test; then
265267
MPTCP_LIB_TEST_COUNTER=$((MPTCP_LIB_TEST_COUNTER+1))
266268
last_test_ignored=1
@@ -448,7 +450,9 @@ reset_with_tcp_filter()
448450
# $1: err msg
449451
fail_test()
450452
{
451-
ret=${KSFT_FAIL}
453+
if ! mptcp_lib_subtest_is_flaky; then
454+
ret=${KSFT_FAIL}
455+
fi
452456

453457
if [ ${#} -gt 0 ]; then
454458
print_fail "${@}"
@@ -3069,6 +3073,7 @@ fullmesh_tests()
30693073
fastclose_tests()
30703074
{
30713075
if reset_check_counter "fastclose test" "MPTcpExtMPFastcloseTx"; then
3076+
MPTCP_LIB_SUBTEST_FLAKY=1
30723077
test_linkfail=1024 fastclose=client \
30733078
run_tests $ns1 $ns2 10.0.1.1
30743079
chk_join_nr 0 0 0
@@ -3077,6 +3082,7 @@ fastclose_tests()
30773082
fi
30783083

30793084
if reset_check_counter "fastclose server test" "MPTcpExtMPFastcloseRx"; then
3085+
MPTCP_LIB_SUBTEST_FLAKY=1
30803086
test_linkfail=1024 fastclose=server \
30813087
run_tests $ns1 $ns2 10.0.1.1
30823088
chk_join_nr 0 0 0 0 0 0 1
@@ -3095,6 +3101,7 @@ fail_tests()
30953101
{
30963102
# single subflow
30973103
if reset_with_fail "Infinite map" 1; then
3104+
MPTCP_LIB_SUBTEST_FLAKY=1
30983105
test_linkfail=128 \
30993106
run_tests $ns1 $ns2 10.0.1.1
31003107
chk_join_nr 0 0 0 +1 +0 1 0 1 "$(pedit_action_pkts)"
@@ -3103,6 +3110,7 @@ fail_tests()
31033110

31043111
# multiple subflows
31053112
if reset_with_fail "MP_FAIL MP_RST" 2; then
3113+
MPTCP_LIB_SUBTEST_FLAKY=1
31063114
tc -n $ns2 qdisc add dev ns2eth1 root netem rate 1mbit delay 5ms
31073115
pm_nl_set_limits $ns1 0 1
31083116
pm_nl_set_limits $ns2 0 1

tools/testing/selftests/net/mptcp/mptcp_lib.sh

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ declare -rx MPTCP_LIB_AF_INET6=10
2121

2222
MPTCP_LIB_SUBTESTS=()
2323
MPTCP_LIB_SUBTESTS_DUPLICATED=0
24+
MPTCP_LIB_SUBTEST_FLAKY=0
2425
MPTCP_LIB_TEST_COUNTER=0
2526
MPTCP_LIB_TEST_FORMAT="%02u %-50s"
2627
MPTCP_LIB_IP_MPTCP=0
@@ -41,6 +42,16 @@ else
4142
readonly MPTCP_LIB_COLOR_RESET=
4243
fi
4344

45+
# SELFTESTS_MPTCP_LIB_OVERRIDE_FLAKY env var can be set not to ignore errors
46+
# from subtests marked as flaky
47+
mptcp_lib_override_flaky() {
48+
[ "${SELFTESTS_MPTCP_LIB_OVERRIDE_FLAKY:-}" = 1 ]
49+
}
50+
51+
mptcp_lib_subtest_is_flaky() {
52+
[ "${MPTCP_LIB_SUBTEST_FLAKY}" = 1 ] && ! mptcp_lib_override_flaky
53+
}
54+
4455
# $1: color, $2: text
4556
mptcp_lib_print_color() {
4657
echo -e "${MPTCP_LIB_START_PRINT:-}${*}${MPTCP_LIB_COLOR_RESET}"
@@ -72,7 +83,16 @@ mptcp_lib_pr_skip() {
7283
}
7384

7485
mptcp_lib_pr_fail() {
75-
mptcp_lib_print_err "[FAIL]${1:+ ${*}}"
86+
local title cmt
87+
88+
if mptcp_lib_subtest_is_flaky; then
89+
title="IGNO"
90+
cmt=" (flaky)"
91+
else
92+
title="FAIL"
93+
fi
94+
95+
mptcp_lib_print_err "[${title}]${cmt}${1:+ ${*}}"
7696
}
7797

7898
mptcp_lib_pr_info() {
@@ -208,7 +228,13 @@ mptcp_lib_result_pass() {
208228

209229
# $1: test name
210230
mptcp_lib_result_fail() {
211-
__mptcp_lib_result_add "not ok" "${1}"
231+
if mptcp_lib_subtest_is_flaky; then
232+
# It might sound better to use 'not ok # TODO' or 'ok # SKIP',
233+
# but some CIs don't understand 'TODO' and treat SKIP as errors.
234+
__mptcp_lib_result_add "ok" "${1} # IGNORE Flaky"
235+
else
236+
__mptcp_lib_result_add "not ok" "${1}"
237+
fi
212238
}
213239

214240
# $1: test name

tools/testing/selftests/net/mptcp/simult_flows.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ run_test()
244244
do_transfer $small $large $time
245245
lret=$?
246246
mptcp_lib_result_code "${lret}" "${msg}"
247-
if [ $lret -ne 0 ]; then
247+
if [ $lret -ne 0 ] && ! mptcp_lib_subtest_is_flaky; then
248248
ret=$lret
249249
[ $bail -eq 0 ] || exit $ret
250250
fi
@@ -254,7 +254,7 @@ run_test()
254254
do_transfer $large $small $time
255255
lret=$?
256256
mptcp_lib_result_code "${lret}" "${msg}"
257-
if [ $lret -ne 0 ]; then
257+
if [ $lret -ne 0 ] && ! mptcp_lib_subtest_is_flaky; then
258258
ret=$lret
259259
[ $bail -eq 0 ] || exit $ret
260260
fi
@@ -290,7 +290,7 @@ run_test 10 10 0 0 "balanced bwidth"
290290
run_test 10 10 1 25 "balanced bwidth with unbalanced delay"
291291

292292
# we still need some additional infrastructure to pass the following test-cases
293-
run_test 10 3 0 0 "unbalanced bwidth"
293+
MPTCP_LIB_SUBTEST_FLAKY=1 run_test 10 3 0 0 "unbalanced bwidth"
294294
run_test 10 3 1 25 "unbalanced bwidth with unbalanced delay"
295295
run_test 10 3 25 1 "unbalanced bwidth with opposed, unbalanced delay"
296296

0 commit comments

Comments
 (0)