mirror of
				https://github.com/esphome/esphome.git
				synced 2025-10-30 22:53:59 +00:00 
			
		
		
		
	fix race
This commit is contained in:
		| @@ -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"); | ||||
|   }); | ||||
| } | ||||
|  | ||||
|   | ||||
| @@ -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) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user