diff --git a/tests/integration/fixtures/external_components/scheduler_rapid_cancellation_component/rapid_cancellation_component.cpp b/tests/integration/fixtures/external_components/scheduler_rapid_cancellation_component/rapid_cancellation_component.cpp index cd4e019882..b735c453f2 100644 --- a/tests/integration/fixtures/external_components/scheduler_rapid_cancellation_component/rapid_cancellation_component.cpp +++ b/tests/integration/fixtures/external_components/scheduler_rapid_cancellation_component/rapid_cancellation_component.cpp @@ -70,6 +70,9 @@ void SchedulerRapidCancellationComponent::run_rapid_cancellation_test() { ESP_LOGI(TAG, " Implicit cancellations (replaced): %d", implicit_cancellations); ESP_LOGI(TAG, " Total accounted: %d (executed + implicit cancellations)", this->total_executed_.load() + implicit_cancellations); + + // Final message to signal test completion - ensures all stats are logged before test ends + ESP_LOGI(TAG, "Test finished - all statistics reported"); }); } diff --git a/tests/integration/test_scheduler_rapid_cancellation.py b/tests/integration/test_scheduler_rapid_cancellation.py index 89c41a4c33..90577f36f1 100644 --- a/tests/integration/test_scheduler_rapid_cancellation.py +++ b/tests/integration/test_scheduler_rapid_cancellation.py @@ -74,9 +74,9 @@ async def test_scheduler_rapid_cancellation( test_complete_future.set_exception(Exception(f"Crash detected: {line}")) return - # Check for completion + # Check for completion - wait for final message after all stats are logged if ( - "Rapid cancellation test complete" in line + "Test finished - all statistics reported" in line and not test_complete_future.done() ): test_complete_future.set_result(None)