Fix-Point opened a new pull request, #3382:
URL: https://github.com/apache/nuttx-apps/pull/3382
## Summary
This PR introduces several enhancements and fixes across multiple testing
modules in the NuttX test suite:
1. **Spinlock Test Enhancement** (`testing/ostest/spinlock.c`):
- Added comprehensive spinlock testing framework with support for regular
spinlocks, recursive spinlocks (rspinlock), and sequence counters (seqlock)
- Refactored the test to improve accuracy and minimize scheduling jitters
by:
- Using atomic operations instead of pthread barriers for
synchronization
- Setting thread affinity and maximum priority for more consistent
timing
- Adding CPU core distribution for SMP configurations
- Fixed Coverity issues by adding null check for `total_ns` and
correcting loop boundary conditions
- Added proper error checking for pthread operations
2. **Timer Test Improvements**:
- Fixed output formatting for timer tests to handle `timer_t` type changes
- Relaxed timing constraints for simulated environments (QEMU/SIM) to
account for vCPU preemption
- Fixed timer assertion logic in periodic timer tests
- Addressed time calculation overflow issues by changing `uint32_t` to
`uint64_t`
3. **Other Test Fixes**:
- Fixed a synchronization bug in watchdog timer test where callback count
update order could cause random failures
- Re-enabled work queue test in flat build mode
- Added clock measurement to taclebench benchmark
- Fixed timer jitter test parameters to avoid errors with large
`USEC_PER_TICK` settings
## Impact
- **Testing Coverage**: Significantly improves spinlock testing with support
for multiple lock types and SMP configurations
- **Test Reliability**: Fixes timing issues in simulated environments,
making tests more robust on QEMU and simulation platforms
- **Code Quality**: Addresses multiple Coverity issues and adds proper error
handling
- **Performance**: Improved test accuracy through better thread scheduling
and affinity management
- **Compatibility**: Maintains backward compatibility while fixing
type-related formatting issues
- **Documentation**: Enhanced test output formatting for better debugging
and analysis
- **Build System**: No impact on build process; all changes are confined to
test modules
## Test
Internal CI/CT passed. Tested on `rv-virt:smp`, `ostest` passed.
--
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]