testing/ostest: Exercise custom work queues. - #3759
Conversation
8d35b54 to
e6b1b16
Compare
|
Thanks for the earlier review. I force-pushed the branch to rebase and
The Protected kernel harness is intentionally not included in this apps PR. The final two-commit version was validated on an STM32H7 PX4 FMUv6C:
All runs completed successfully, and repeated runs showed no cumulative |
|
|
||
| static int wait_sem(FAR sem_t *sem) | ||
| { | ||
| #ifdef __KERNEL__ |
There was a problem hiding this comment.
why need check __KERNEL__
|
|
||
| #include "ostest.h" | ||
|
|
||
| #ifdef CONFIG_DISABLE_PTHREAD |
| default y | ||
| depends on !DISABLE_PTHREAD | ||
| depends on (BUILD_FLAT && SCHED_WORKQUEUE) || LIBC_USRWORK | ||
| depends on (BUILD_FLAT && !DISABLE_PTHREAD && SCHED_WORKQUEUE) || LIBC_USRWORK |
There was a problem hiding this comment.
sqaush into the first patch
Add a focused wqueue entry that exercises predefined and dynamically created work queues without changing the no-argument ostest flow. Share the semaphore wait and basic worker helpers across configurations. Flat builds exercise scheduler queues, Protected builds exercise USRWORK, and pthread-enabled builds additionally cover configurable custom worker pools. When pthread support is disabled, only predefined USRWORK cases are compiled. Cover invalid arguments, priority lookup, immediate and delayed work, pending replacement and cancellation, periodic requeue, synchronous and parallel cancellation, concurrent queues, callback self-destruction, and queue teardown. Assisted-by: Codex:GPT-5 Signed-off-by: DuoYuWang <thirteenking.wang@gmail.com>
e6b1b16 to
e5e05b4
Compare
|
Thanks for the review, and sorry for the delayed update. I force-pushed the branch after addressing all three comments:
The branch is now a single commit rebased onto the current nuttx-apps master. I rebuilt and tested the updated code on PX4 FMUv6C in Flat, Protected, and Protected-with-pthreads-disabled configurations. All work queue tests passed, including repeated runs without cumulative heap growth. |
Summary
queues with one and two workers.
queues in non-Flat builds.
ostest wqueueas a focused entry without changing the originalno-argument ostest flow.
pending replacement, synchronous and parallel cancellation, multiple
simultaneous queues, self-destruction rejection, and teardown.
resources.
Impact
queues.
in non-Flat builds; the focused test is selected with
ostest wqueue.CONFIG_TESTING_OSTEST_WQUEUEdefaults to enabledonly when its pthread and work queue dependencies are available.
Kconfig help describes backend selection.
expanded.
Testing
Build host:
Target:
48ddaadad1499404addd891190f64cccf50008b2Before change:
Build output after change:
Runtime output summary:
All three runs for each backend completed without assertion. Current heap
usage did not increase after the first run, and all custom workers exited.
Validation:
PR verification Self-Check