[PATCH mptcp-net 0/3] selftests: mptcp: avoid spurious errors on TCP disconnect

Matthieu Baerts (NGI0) posted 3 patches 5 months, 3 weeks ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/multipath-tcp/mptcp_net-next tags/patchew/20250819-sft-mptcp-disc-err-v1-0-9d0cf296bc13@kernel.org
There is a newer version of this series
tools/testing/selftests/net/mptcp/mptcp_connect.c | 10 +++++++---
tools/testing/selftests/net/mptcp/mptcp_lib.sh    | 12 +++++++++++-
2 files changed, 18 insertions(+), 4 deletions(-)
[PATCH mptcp-net 0/3] selftests: mptcp: avoid spurious errors on TCP disconnect
Posted by Matthieu Baerts (NGI0) 5 months, 3 weeks ago
This should fix the recent instabilities seen by MPTCP and NIPA CIs
where the 'mptcp_connect.sh' tests fail regularly when running the
'disconnect' subtests with "plain" TCP sockets, e.g.

  # INFO: disconnect
  # 63 ns1 MPTCP -> ns1 (10.0.1.1:20001      ) MPTCP     (duration   996ms) [ OK ]
  # 64 ns1 MPTCP -> ns1 (10.0.1.1:20002      ) TCP       (duration   851ms) [ OK ]
  # 65 ns1 TCP   -> ns1 (10.0.1.1:20003      ) MPTCP     Unexpected revents: POLLERR/POLLNVAL(19)
  # (duration   896ms) [FAIL] file received by server does not match (in, out):
  # -rw-r--r-- 1 root root 11112852 Aug 19 09:16 /tmp/tmp.hlJe5DoMoq.disconnect
  # Trailing bytes are:
  # /{ga 6@=#.8:-rw------- 1 root root 10085368 Aug 19 09:16 /tmp/tmp.blClunilxx
  # Trailing bytes are:
  # /{ga 6@=#.8:66 ns1 MPTCP -> ns1 (dead:beef:1::1:20004) MPTCP     (duration   987ms) [ OK ]
  # 67 ns1 MPTCP -> ns1 (dead:beef:1::1:20005) TCP       (duration   911ms) [ OK ]
  # 68 ns1 TCP   -> ns1 (dead:beef:1::1:20006) MPTCP     (duration   980ms) [ OK ]
  # [FAIL] Tests of the full disconnection have failed

Patch 2 fixes this issue, while Patch 1 and 3 improves the errors
reported by the selftest.

Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
---
Matthieu Baerts (NGI0) (3):
      selftests: mptcp: connect: catch IO errors on listen side
      selftests: mptcp: avoid spurious errors on TCP disconnect
      selftests: mptcp: print trailing bytes with hexdump

 tools/testing/selftests/net/mptcp/mptcp_connect.c | 10 +++++++---
 tools/testing/selftests/net/mptcp/mptcp_lib.sh    | 12 +++++++++++-
 2 files changed, 18 insertions(+), 4 deletions(-)
---
base-commit: 27427f653031e9aca497b147b2d8eb86bf12fb9e
change-id: 20250806-sft-mptcp-disc-err-3357b769bcdb

Best regards,
-- 
Matthieu Baerts (NGI0) <matttbe@kernel.org>
Re: [PATCH mptcp-net 0/3] selftests: mptcp: avoid spurious errors on TCP disconnect
Posted by Mat Martineau 5 months, 2 weeks ago
On Tue, 19 Aug 2025, Matthieu Baerts (NGI0) wrote:

> This should fix the recent instabilities seen by MPTCP and NIPA CIs
> where the 'mptcp_connect.sh' tests fail regularly when running the
> 'disconnect' subtests with "plain" TCP sockets, e.g.
>
>  # INFO: disconnect
>  # 63 ns1 MPTCP -> ns1 (10.0.1.1:20001      ) MPTCP     (duration   996ms) [ OK ]
>  # 64 ns1 MPTCP -> ns1 (10.0.1.1:20002      ) TCP       (duration   851ms) [ OK ]
>  # 65 ns1 TCP   -> ns1 (10.0.1.1:20003      ) MPTCP     Unexpected revents: POLLERR/POLLNVAL(19)
>  # (duration   896ms) [FAIL] file received by server does not match (in, out):
>  # -rw-r--r-- 1 root root 11112852 Aug 19 09:16 /tmp/tmp.hlJe5DoMoq.disconnect
>  # Trailing bytes are:
>  # /{ga 6@=#.8:-rw------- 1 root root 10085368 Aug 19 09:16 /tmp/tmp.blClunilxx
>  # Trailing bytes are:
>  # /{ga 6@=#.8:66 ns1 MPTCP -> ns1 (dead:beef:1::1:20004) MPTCP     (duration   987ms) [ OK ]
>  # 67 ns1 MPTCP -> ns1 (dead:beef:1::1:20005) TCP       (duration   911ms) [ OK ]
>  # 68 ns1 TCP   -> ns1 (dead:beef:1::1:20006) MPTCP     (duration   980ms) [ OK ]
>  # [FAIL] Tests of the full disconnection have failed
>
> Patch 2 fixes this issue, while Patch 1 and 3 improves the errors
> reported by the selftest.
>
> Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
> ---

With Paolo's suggestion for patch 2 (include close-wait state) and mine 
for patch 3 ('od') included, this LGTM:

Reviewed-by: Mat Martineau <martineau@kernel.org>


> Matthieu Baerts (NGI0) (3):
>      selftests: mptcp: connect: catch IO errors on listen side
>      selftests: mptcp: avoid spurious errors on TCP disconnect
>      selftests: mptcp: print trailing bytes with hexdump
>
> tools/testing/selftests/net/mptcp/mptcp_connect.c | 10 +++++++---
> tools/testing/selftests/net/mptcp/mptcp_lib.sh    | 12 +++++++++++-
> 2 files changed, 18 insertions(+), 4 deletions(-)
> ---
> base-commit: 27427f653031e9aca497b147b2d8eb86bf12fb9e
> change-id: 20250806-sft-mptcp-disc-err-3357b769bcdb
>
> Best regards,
> -- 
> Matthieu Baerts (NGI0) <matttbe@kernel.org>
>
>
>
Re: [PATCH mptcp-net 0/3] selftests: mptcp: avoid spurious errors on TCP disconnect
Posted by MPTCP CI 5 months, 3 weeks ago
Hi Matthieu,

Thank you for your modifications, that's great!

Our CI did some validations and here is its report:

- KVM Validation: normal: Unstable: 1 failed test(s): packetdrill_fastopen 🔴
- KVM Validation: debug: Success! ✅
- KVM Validation: btf-normal (only bpftest_all): Success! ✅
- KVM Validation: btf-debug (only bpftest_all): Success! ✅
- Task: https://github.com/multipath-tcp/mptcp_net-next/actions/runs/17078272848

Initiator: Patchew Applier
Commits: https://github.com/multipath-tcp/mptcp_net-next/commits/3c178d4c6234
Patchwork: https://patchwork.kernel.org/project/mptcp/list/?series=993167


If there are some issues, you can reproduce them using the same environment as
the one used by the CI thanks to a docker image, e.g.:

    $ cd [kernel source code]
    $ docker run -v "${PWD}:${PWD}:rw" -w "${PWD}" --privileged --rm -it \
        --pull always mptcp/mptcp-upstream-virtme-docker:latest \
        auto-normal

For more details:

    https://github.com/multipath-tcp/mptcp-upstream-virtme-docker


Please note that despite all the efforts that have been already done to have a
stable tests suite when executed on a public CI like here, it is possible some
reported issues are not due to your modifications. Still, do not hesitate to
help us improve that ;-)

Cheers,
MPTCP GH Action bot
Bot operated by Matthieu Baerts (NGI0 Core)