chengkai15 opened a new pull request, #4140: URL: https://github.com/apache/nuttx-apps/pull/4140
*Note: Please adhere to [Contributing Guidelines](https://github.com/apache/nuttx/blob/master/CONTRIBUTING.md).* Depends-On: apache/nuttx/pull/22268 ## Summary Regression test for `work_queue_init()` and `work_queue_run()` (apache/nuttx#22268). A queue of `work_queue_init(2)` is served by two pthreads of the test task that call `work_queue_run()`. The test checks that: - work queued before the threads start runs; - it runs in the task: `getpid()` is the pid of the task, and a file descriptor that the task opened can be written; - both threads serve the queue at the same time (sync and parallel cancel tests), and a third `work_queue_run()` returns `-EBUSY`; - the priority tests pass on the queue; - `work_queue_run()` returns 0 in both threads after `work_queue_free()`; - `work_queue_free()` does not wait for a slot that no thread took. ## Impact - `testing/ostest/wqueue.c` only. It needs apache/nuttx#22268 (the interfaces are new, so the test does not build on master), so this PR stays in draft until that one is merged. ## Testing **sim:ostest (flat), full ostest (4 loops, no errors):** ``` wqueue_test: work_queue_run wqueue_test: worker pid = 5, expect = 5, write = 1 wqueue_test: sync cancel finished = 1, expect = 1 wqueue_test: parallel callbacks = 2, expect = 2 wqueue_test: work_queue_run() = 0, expect = 0 wqueue_test: work_queue_run() = 0, expect = 0 wqueue_test: work_queue_run done ``` **mps2-an500:citest_protected (protected) + `CONFIG_LIBC_USRWORK`, qemu-system-arm, `ostest wqueue`:** ``` wqueue_test: work_queue_run wqueue_test: worker pid = 5, expect = 5, write = 1 wqueue_test: work_queue_run() = 0, expect = 0 wqueue_test: work_queue_run() = 0, expect = 0 wqueue_test: work_queue_run done ``` **qemu-armv7a:citest_knsh (kernel) + `CONFIG_LIBC_USRWORK`, qemu-system-arm, `ostest wqueue`:** ``` wqueue_test: work_queue_run wqueue_test: worker pid = 4, expect = 4, write = 1 wqueue_test: work_queue_run() = 0, expect = 0 wqueue_test: work_queue_run() = 0, expect = 0 wqueue_test: work_queue_run done ``` On protected and kernel, `ostest wqueue` fails on master before it reaches this case, in existing checks: cancelling idle work on a libc custom queue does not return `-ENOENT` (both builds), and the callbacks of the predefined USRWORK queue do not run (kernel). For these two runs those checks were disabled locally. Not tested: CMake, SMP, real hardware. -- 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]
