ostest: reduce time and fix bugs cause by reducing time #3334
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.
Note: Please adhere to Contributing Guidelines.
Summary
This PR optimizes the ostest suite execution time and fixes several reliability issues:
Reduce test execution time: Reduced sleep() durations across multiple test cases, decreasing total test time from ~150s to ~60s (60% reduction) while maintaining test effectiveness.
Fix timing-related test failures: Replaced timing-based synchronization (usleep/sleep) with deterministic event-based synchronization (semaphore polling, waitpid) to eliminate race conditions on slower systems or under high load.
Fix SMP-related race conditions:
Changes by category:
Impact
Users:
Build process: No impact - pure test code changes
Compatibility: Fully backward compatible - no API or behavior changes to tested components
Testing reliability: Significantly improved - eliminates timing-dependent race conditions that caused intermittent failures
Testing
Verification performed:
Test configurations verified:
Before changes:
After changes:
Build verification:
The changes maintain test coverage while significantly improving execution speed and reliability.