Skip to content

testing/ostest: Test work_timeleft() of a work that expired - #4132

Draft
Shanks0224 wants to merge 1 commit into
apache:masterfrom
Shanks0224:ostest-wq-timeleft
Draft

Shanks0224 wants to merge 1 commit into
apache:masterfrom
Shanks0224:ostest-wq-timeleft

Conversation

@Shanks0224

@Shanks0224 Shanks0224 commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Note: Please adhere to Contributing Guidelines.

Summary

In the custom work queue test with one worker, keep the worker busy, let
a second work expire behind it and check that work_timeleft() returns
zero for it. Also check that it returns the remaining ticks, at most the
delay, for a work that has not expired yet.

depends-on: apache/nuttx#22294

Impact

New test only. Without apache/nuttx#22294 the expired work gives a
negative time left and the test asserts.

Testing

Build host: Linux x86_64. sim:nsh + CONFIG_TESTING_OSTEST.

Without apache/nuttx#22294:

wqueue_test: time left
wqueue_test: time left of an expired work = -4, expect = 0
dump_assert_info: Assertion failed left == 0: at file: :0 task: ostest process: ostest 0x400a3e93

With it:

wqueue_test: time left
wqueue_test: time left of an expired work = 0, expect = 0
...
ostest_main: Exiting with status 0

Keep the only worker of a custom work queue busy, let a second work
expire behind it and check that work_timeleft() returns zero for it, and
that it returns the remaining ticks, at most the delay, for a work that
has not expired yet.  Before the fix in nuttx the expired work gave a
negative time left.

Signed-off-by: ganjing <ganjing@xiaomi.com>
@github-actions

Copy link
Copy Markdown

⚠️ depends-on could not be parsed

A depends-on: line was found in the PR description, but no valid dependency was parsed. Supported repositories: apache/nuttx, apache/nuttx-apps; the PR id must be numeric.

Expected format:

depends-on: [apache/nuttx/pull/<N> apache/nuttx-apps/pull/<M>]

CI run: https://github.com/apache/nuttx-apps/actions/runs/45538875911

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant