Summary
Replace std::this_thread::sleep_for with deterministic event-based synchronization primitives to eliminate test flakiness.
Background
The current test suite relies on time-based waits (e.g., sleep_for(100ms)). This causes two major issues:
- Flakiness: Tests fail on busy CI runners if the operation takes longer than the hardcoded wait time.
- Slowness: Tests wait longer than necessary (e.g., waiting 100ms for an operation that takes 1ms).
Tasks
Refactor the following files to use std::promise/future, std::condition_variable, or std::latch:
integration_tests/failures/error_handling_test.cpp
integration_tests/framework/test_helpers.h
integration_tests/scenarios/event_bus_integration_test.cpp
integration_tests/scenarios/full_system_integration_test.cpp
integration_tests/scenarios/runtime_binding_integration_test.cpp
integration_tests/stress/stress_test.cpp
tests/config_watcher_test.cpp
tests/event_bus_failure_test.cpp
tests/executor_test.cpp
tests/global_logger_registry_test.cpp
tests/improved_event_bus_test.cpp
tests/thread_safety_tests.cpp
tests/unified_bootstrapper_test.cpp
Acceptance Criteria
Summary
Replace
std::this_thread::sleep_forwith deterministic event-based synchronization primitives to eliminate test flakiness.Background
The current test suite relies on time-based waits (e.g.,
sleep_for(100ms)). This causes two major issues:Tasks
Refactor the following files to use
std::promise/future,std::condition_variable, orstd::latch:integration_tests/failures/error_handling_test.cppintegration_tests/framework/test_helpers.hintegration_tests/scenarios/event_bus_integration_test.cppintegration_tests/scenarios/full_system_integration_test.cppintegration_tests/scenarios/runtime_binding_integration_test.cppintegration_tests/stress/stress_test.cpptests/config_watcher_test.cpptests/event_bus_failure_test.cpptests/executor_test.cpptests/global_logger_registry_test.cpptests/improved_event_bus_test.cpptests/thread_safety_tests.cpptests/unified_bootstrapper_test.cppAcceptance Criteria
sleep_forusage in test logic is replaced with synchronization primitives.--gtest_repeat=100.