vsock/test: retry send() to avoid occasional failure in sigpipe test
authorStefano Garzarella <sgarzare@redhat.com>
Wed, 14 May 2025 14:19:26 +0000 (16:19 +0200)
committerJakub Kicinski <kuba@kernel.org>
Sat, 17 May 2025 01:01:32 +0000 (18:01 -0700)
commit135a8a4d25a2937b2727e3857471f305d78496da
tree596eeb2c47ba087f0a697c846afb98680bd47191
parenta7262ed4b163c411b450d74f2c7b34bde19ac78e
vsock/test: retry send() to avoid occasional failure in sigpipe test

When the other peer calls shutdown(SHUT_RD), there is a chance that
the send() call could occur before the message carrying the close
information arrives over the transport. In such cases, the send()
might still succeed. To avoid this race, let's retry the send() call
a few times, ensuring the test is more reliable.

Sleep a little before trying again to avoid flooding the other peer
and filling its receive buffer, causing false-negative.

Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
Link: https://patch.msgid.link/20250514141927.159456-3-sgarzare@redhat.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
tools/testing/vsock/vsock_test.c