cederom commented on PR #4099:
URL: https://github.com/apache/nuttx-apps/pull/4099#issuecomment-7043892640

   Testing Claude review ;-)
   
   Summary of PR #4099 – testing/nettest: TCP SO_SNDTIMEO / IOB leak test
   (apache/nuttx-apps, draft, author: casaroli, 1 approval of 2 required)
   
   Adds test_tcp_sndtimeo_iob to cmocka_net_tcp (one commit, 5 files, +301/-0).
   A loopback TCP connection is created whose reader never reads; the sender
   sets SO_SNDTIMEO=100 ms and sends 4 KiB blocks until 10 sends fail with
   EAGAIN. After all sockets close, the test requires the free IOB count in
   /proc/iobinfo to return to its starting value (polled up to 3 s).
   Skipped without /proc/iobinfo or when send() returns ENOMEM. Built only with
   CONFIG_NET_IPv4 && CONFIG_NET_SOCKOPTS && CONFIG_NET_TCP_WRITE_BUFFERS.
   
   It is the regression test for apache/nuttx#22129 ("mm/iob: Undo the waiter
   count of an IOB wait that ends without an IOB"): per the author, master
   leaks one IOB per timed-out send. Reported testing: fails on master and
   passes with the fix on qemu-armv8a knsh (61/72 free) and flat nsh (85/96
   free); -Werror builds clean; checkpatch passes. nuttx#22129 must be merged
   first, otherwise this test fails in CI.
   
   Open review notes:
   1. Build guards: Makefile/CMake require IPv4+SOCKOPTS+TCP_WRITE_BUFFERS, but
      test_tcp.c/.h guard only on CONFIG_NET_TCP_WRITE_BUFFERS inside the outer
      #if - please confirm the outer condition matches, otherwise some configs
      will fail to link.
   2. With CONFIG_NET_SEND_BUFSIZE > 0 the sends may time out on the SO_SNDBUF
      wait rather than the IOB wait, so the leak path may not be exercised.
   3. Close order: the sender (fds[1]) is closed before the peer holding unread
      data (fds[2]); closing fds[2] first would reset the connection right away
      and make buffer recovery more deterministic.
   4. With a large IOB pool, 2000 x 4 KiB may never reach 10 timeouts and the
      test fails instead of skipping (tested pools were 72/96 IOBs).
   5. Nits: ntotal parsed but unused (%*d); skipping on every ENOMEM could hide
      a real regression that returns ENOMEM.
   
   Overall: clean, small test with correct setup/teardown on skip paths and a
   convincing fail-before/pass-after result. Good to merge after nuttx#22129,
   once the guard question (1) is answered.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to