mirror-linux/tools/testing
Konstantin Shkolnyy 7fd7ad6f36 vsock/test: Fix occasional failure in SIOCOUTQ tests
These tests:
    "SOCK_STREAM ioctl(SIOCOUTQ) 0 unsent bytes"
    "SOCK_SEQPACKET ioctl(SIOCOUTQ) 0 unsent bytes"
output: "Unexpected 'SIOCOUTQ' value, expected 0, got 64 (CLIENT)".

They test that the SIOCOUTQ ioctl reports 0 unsent bytes after the data
have been received by the other side. However, sometimes there is a delay
in updating this "unsent bytes" counter, and the test fails even though
the counter properly goes to 0 several milliseconds later.

The delay occurs in the kernel because the used buffer notification
callback virtio_vsock_tx_done(), called upon receipt of the data by the
other side, doesn't update the counter itself. It delegates that to
a kernel thread (via vsock->tx_work). Sometimes that thread is delayed
more than the test expects.

Change the test to poll SIOCOUTQ until it returns 0 or a timeout occurs.

Signed-off-by: Konstantin Shkolnyy <kshk@linux.ibm.com>
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
Fixes: 18ee44ce97 ("test/vsock: add ioctl unsent bytes test")
Link: https://patch.msgid.link/20250507151456.2577061-1-kshk@linux.ibm.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2025-05-13 15:01:50 -07:00
..
crypto/chacha20-s390 crypto: lib/chacha - remove unused arch-specific init support 2025-03-21 17:39:06 +08:00
cxl cxl: Fix devm host device for CXL fwctl initialization 2025-04-18 09:33:04 -07:00
fault-injection
ktest ktest: Fix Test Failures Due to Missing LOG_FILE Directories 2025-03-27 09:34:00 -04:00
kunit ASoC: stm32: sai: fix kernel rate configuration 2025-05-01 14:43:44 +09:00
memblock memblock tests: add test for memblock_set_node 2025-04-07 09:28:01 +03:00
nvdimm
radix-tree xarray: add xas_try_split() to split a multi-index entry 2025-03-17 22:06:59 -07:00
rbtree lib/interval_tree: add test case for span iteration 2025-03-17 12:17:01 -07:00
scatterlist
selftests tests/ncdevmem: Fix double-free of queue array 2025-05-09 15:05:07 -07:00
shared test suite: use %zu to print size_t 2025-04-11 17:32:35 -07:00
vma mm: make vma cache SLAB_TYPESAFE_BY_RCU 2025-03-16 22:06:21 -07:00
vsock vsock/test: Fix occasional failure in SIOCOUTQ tests 2025-05-13 15:01:50 -07:00