casaroli opened a new pull request, #4188: URL: https://github.com/apache/nuttx-apps/pull/4188
## Summary `test_local_dgram_poll_slots` in `cmocka_net_local_dgram` fails on nuttx master since apache/nuttx#22348 (ed089279a24) changed the default of `CONFIG_DEV_PIPE_NPOLLWAITERS` from 4 to 2. The case polled 4 entries of one datagram socket and accepted only success or `EBUSY`. The FIFO of the socket has slots for 2 waiters now. `poll()` does not fail with `EBUSY` for the third entry: `pipecommon_poll()` returns `-EBUSY`, and `poll_setup()` in `fs/vfs/fs_poll.c` sets `POLLERR` in that entry and makes `poll()` return 1. With 4 slots the case passed, but it did not reach the slot limit. The case now uses `CONFIG_DEV_PIPE_NPOLLWAITERS` (`NET_LOCAL` selects `PIPES`, so it is always defined). In each of 20 rounds, a `poll()` of all slots gives no event, which also shows that the round before kept no slot. Then a `poll()` of one entry more than the slots returns 1, with `POLLERR` only in the last entry. At the end, one waiter still wakes up for a datagram, as before. ## Impact Test only: `testing/nettest/local/test_local_dgram_pollext.c`. No change to NuttX or to other cases. The case now reaches the slot limit with every value of `CONFIG_DEV_PIPE_NPOLLWAITERS`, also with the old default 4. ## Testing CI image (`ghcr.io/apache/nuttx/apache-nuttx-ci-linux`), `-Wno-cpp -Werror`, nuttx master 1af7ac541e4, apps master 9a2c68962, `qemu-armv8a:nsh` with the local socket and cmocka options, QEMU TCG, the whole `cmocka_net_local_dgram` suite: | apps | `CONFIG_DEV_PIPE_NPOLLWAITERS` | `test_local_dgram_poll_slots` | suite | | --- | --- | --- | --- | | master | 2 (default) | FAILED (`ret == 0 \|\| (ret == -1 && errno == EBUSY)`) | 93/94 | | master | 4 | PASSED | 94/94 | | this PR | 2 (default) | PASSED | 94/94 | | this PR | 4 | PASSED | 94/94 | Negative control: with a test-only change in `poll_setup()` that keeps the slots of the entries before a failed entry, the new case fails in its second round (`poll()` of all slots returns 1, not 0). Builds with this PR, no warnings: `qemu-armv8a:nsh` (make and CMake) and `qemu-armv8a:knsh` (make, `make export`, apps `make import`). `tools/checkpatch.sh -c -u -m -g`: all checks pass. -- 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]
