-
Notifications
You must be signed in to change notification settings - Fork 684
testing: Add spinlock test and fix for timer tests. #3382
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
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
Since sim and qemu are not cycle accurate simulators, if the vCPU thread is preempted by other high priority tasks, it may cause timing issues. This is easy to happen when the test machine is busy. This commit modifies the condition of timing error and prints out the latency as a warning. Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
On QEMU, if vcpus are preempted by other threads, the deviation of the timer might be very large, causing assertion failure. This commit addressed the problem. Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
On SIM and QEMU, it is inevitable that the simulating vCPU got preempted by other threads, causing large timing delay. This commit relax the timing constraints to reduce the CT error. Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
On QEMU, if vcpus are preempted by other threads, the deviation of the timer might be very large, causing assertion failure. This commit addressed the problem. Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
This commit fixed the wrong-test case where the time is acquired after the timer being set, leading to the assertion failure. Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
This commit is to make Coverity happy. Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
This commit increased the default interval of the timerjitter to avoid errors with large USEC_PER_TICK setting. Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
This commit used the interval to calculate the timejitter iteration. Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
This commit added clock measurement for taclebench. Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
This commit re-enabled wqueue_test in flat mode. Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
If we updated `callback_cnt` before the `triggered_tick` in the wdog timer callback, the `wdtest_rand` might failed randomly. This commit fixed the synchronizing bug by swapping the execution order of updating. Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
This commmit fixed the time multiplication overflow issue. Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
This commit fixed totally wrong test-cases for the periodical timers. Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
This commit added spinlock/rspinlock test. Signed-off-by: jiangtao16 <jiangtao16@xiaomi.com>
On QEMU, if vcpus are preempted by other threads, the deviation of the timer might be very large, causing assertion failure. This commit addressed the problem. Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
xiaoxiang781216
previously approved these changes
Jan 27, 2026
This commit added checking for the return value. Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
When expanding the macro VERIY, (0 == pthread_barrier_wait(¶m->pub->barrier)) < 0 always false. Regardless of the value of its operands. Signed-off-by: anpeiyun <anpeiyun@xiaomi.com>
This commit added checking for the return value. Signed-off-by: anpeiyun <anpeiyun@xiaomi.com>
This commit refactored the spinlock test for better accuracy and minimized jitters introduced by scheduling. Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
This commit fixed coverity for spinlock test. Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
c228c08 to
4253152
Compare
jerpelea
previously approved these changes
Jan 27, 2026
jerpelea
approved these changes
Jan 27, 2026
Since the kernel spinlocks can only work in flat mode, this commit allowed spinlock_test only in flat mode. Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
8761895 to
0ae2a27
Compare
jerpelea
approved these changes
Jan 27, 2026
xiaoxiang781216
approved these changes
Jan 27, 2026
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
This PR introduces several enhancements and fixes across multiple testing modules in the NuttX test suite:
Spinlock Test Enhancement (
testing/ostest/spinlock.c):total_nsand correcting loop boundary conditionsTimer Test Improvements:
timer_ttype changesuint32_ttouint64_tOther Test Fixes:
USEC_PER_TICKsettingsImpact
Test
Internal CI/CT passed. Tested on
rv-virt:smp,ostestpassed.