cederom commented on PR #4106:
URL: https://github.com/apache/nuttx-apps/pull/4106#issuecomment-7072233072
1. **`test_tcp_procfs_many` will fail now and then.** It requires all 300 of
its connections to appear (`own >= TCP_PROCFS_CONNS`). The race cases that run
just before it leave many connections in TIME_WAIT, and those expire while the
roughly 50 reads of 1 KiB are under way. Each expiry ahead of the read position
hides one of the test's connections (nuttx #1). The fix is either to allow a
few missing, or to wait until earlier connections have drained. The
no-duplicates and the read-ends checks are solid as they are.
2. **The procfs case's config guard is incomplete.** `TEST_TCP_PROCFS`
should also require `CONFIG_NET_TCP_MAX_CONNS == 0` or a value well above 300
plus what earlier cases leave, and a `CONFIG_NET_TCP_WAIT_TIMEOUT` long enough
for the 300 connections to stay in TIME_WAIT.
3. **The backlog cases need a `CONFIG_NET_TCPBACKLOG` guard.** Without a
backlog, client A's connect in `relisten_rst` gets a reset and the case fails
for the wrong reason.
4. **A stall hangs the whole run instead of failing.** The PR says the race
case stalls the network on master. `pthread_join()` on the race clients has no
timeout, so that hangs the entire cmocka run and CI. A timed join or watchdog
would turn it into a failed case.
5. **Possible use-after-free in the test after a failed assert.** If an
assert fails inside `tcp_backlog_race()` after the clients start, the teardown
frees `st` while those threads still use `st->race`, because their thread IDs
(`tids`) are local. Keeping `tids` in the state and joining them in teardown
fixes it.
6. **Nits:**
* `tcp_backlog_now()` computes `tv_sec * 1000` in a `long`, which
overflows on 32-bit targets after about 24.8 days of uptime. The `<
TCP_BACKLOG_CONNECT` check after it adds nothing, since `poll()` already has
that timeout.
* The busy clients create a lot of TIME_WAIT connections; with a fixed
pool of connections, later cases may run out.
The PR description also says the test server needs nuttx-apps #4103; that
should be listed as a dependency.
--
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]