testing/ostest: Exercise custom work queues. - #3759
Open
13022591351 wants to merge 2 commits into
Open
Conversation
This was referenced Aug 27, 2026
xiaoxiang781216
previously approved these changes
Aug 27, 2026
Add an ostest wqueue entry that runs against scheduler queues in Flat builds and libc user queues in non-Flat builds without changing the original no-argument ostest flow. Cover custom worker pools, explicit caller priorities, invalid arguments, periodic and pending replacement, synchronous and parallel cancellation, multiple concurrent queues, self-destruction rejection, and teardown. Check API results, release local semaphores, and fix pre-existing style findings in the touched ostest_main.c file. Tested on an STM32H7 PX4 FMUv6C in Flat and Protected user configurations. Assisted-by: Codex:GPT-5 Signed-off-by: DuoYuWang <thirteenking.wang@gmail.com>
13022591351
force-pushed
the
testing/custom-work-queues
branch
from
August 29, 2026 12:36
0c304a7 to
8d35b54
Compare
Allow CONFIG_TESTING_OSTEST_WQUEUE to build when LIBC_USRWORK is enabled and pthread support is disabled. In that configuration, exercise the predefined USRWORK queue while leaving the existing pthread-backed custom queue tests unchanged. Collect failures across the no-pthread test cases, use bounded waits, clean up queued work and semaphores, and report one final result. Tested on an STM32H7 PX4 FMUv6C in a Protected build with pthread support disabled. Signed-off-by: DuoYuWang <thirteenking.wang@gmail.com>
13022591351
force-pushed
the
testing/custom-work-queues
branch
from
August 29, 2026 12:38
8d35b54 to
e6b1b16
Compare
Author
|
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__ |
Contributor
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 |
Contributor
There was a problem hiding this comment.
sqaush into the first patch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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