-
Story
-
Resolution: Unresolved
-
Major
-
None
-
None
-
None
-
3
-
False
-
-
False
-
rhos-ops-platform-services-pidone
-
-
-
PIDONE 18.0.4, PIDONE 18.0.5, PIDONE 18.0.6, PIDONE 18.0.7, PIDONE 18.0.8, Sprint 1, Sprint 2, Sprint 3, Sprint 4, Sprint 5, Sprint 7
-
11
The current implementation of threading-related tests in oslo.service is heavily dependent on the threading environment. This dependency can lead to inconsistent test results across different setups.
For instance, several tests (test_stop_current_thread, test_stop_immediately, etc.) fail intermittently in local environments due to timing issues or differences in thread states. While these issues do not manifest on the CI, they pose challenges for local development and debugging.
Proposed Improvements:
Introduce timeouts to prevent indefinite waits
- Ensure tests fail gracefully if an expected event (e.g., thread completion) does not occur within a reasonable timeout.
Replace deprecated methods (cancel)
- Use stop() with appropriate flags (e.g., graceful=False) for better clarity and long-term compatibility.
Add explicit state checks for threads and timers
- Verify the state of threads (e.g., thread.dead) to ensure tests are deterministic and robust.
These changes aim to enhance the reliability and consistency of threading tests across environments while ensuring future-proof compatibility.