Commit e7968b774 for clamav.net
commit e7968b7745b866bfcef71af3da51c148f31ff54f
Author: Valerie Snyder <valsnyde@cisco.com>
Date: Thu Aug 6 00:09:52 2026 -0400
unit_tests: Avoid Linux TCP timeout in STATS test
Do not artificially shrink the receive buffer in the slow-client
test. Linux TCP flow control can otherwise delay the intentionally
large response long enough for mdprintf() to time out after only a
partial write.
Keeping the sender buffer limited and nonblocking preserves the
partial-write and slow-client coverage while allowing the reader to
drain the complete STATS response.
CLAM-3052
diff --git a/unit_tests/check_clamd.c b/unit_tests/check_clamd.c
index e9c3d5075..9b24069c5 100644
--- a/unit_tests/check_clamd.c
+++ b/unit_tests/check_clamd.c
@@ -1177,9 +1177,6 @@ START_TEST(test_stats_write_does_not_hold_pool_lock)
ck_assert_int_eq(setsockopt(sockets[1], SOL_SOCKET, SO_SNDBUF,
(const char *)&send_buffer_size, sizeof(send_buffer_size)),
0);
- ck_assert_int_eq(setsockopt(sockets[0], SOL_SOCKET, SO_RCVBUF,
- (const char *)&send_buffer_size, sizeof(send_buffer_size)),
- 0);
/* Match clamd's accepted client sockets and force mdprintf() to retry
* after a partial, nonblocking send. */