mirror of
				https://github.com/esphome/esphome.git
				synced 2025-10-30 22:53:59 +00:00 
			
		
		
		
	preen
This commit is contained in:
		| @@ -58,7 +58,8 @@ async def test_defer_fifo_simple( | ||||
|         # Get the event loop | ||||
|         loop = asyncio.get_running_loop() | ||||
|  | ||||
|         # Subscribe to states (events are delivered as EventStates through subscribe_states) | ||||
|         # Subscribe to states | ||||
|         # (events are delivered as EventStates through subscribe_states) | ||||
|         test_complete_future: asyncio.Future[bool] = loop.create_future() | ||||
|         test_result_future: asyncio.Future[bool] = loop.create_future() | ||||
|  | ||||
|   | ||||
| @@ -58,7 +58,8 @@ async def test_defer_stress( | ||||
|         # Check FIFO ordering within thread | ||||
|         if thread_executions[thread_id] and thread_executions[thread_id][-1] >= index: | ||||
|             fifo_violations.append( | ||||
|                 f"Thread {thread_id}: index {index} executed after {thread_executions[thread_id][-1]}" | ||||
|                 f"Thread {thread_id}: index {index} executed after " | ||||
|                 f"{thread_executions[thread_id][-1]}" | ||||
|             ) | ||||
|  | ||||
|         thread_executions[thread_id].append(index) | ||||
| @@ -99,8 +100,9 @@ async def test_defer_stress( | ||||
|         except asyncio.TimeoutError: | ||||
|             # Report how many we got | ||||
|             pytest.fail( | ||||
|                 f"Stress test timed out. Only {len(executed_defers)} of 1000 defers executed. " | ||||
|                 f"Missing IDs: {sorted(set(range(1000)) - executed_defers)[:10]}..." | ||||
|                 f"Stress test timed out. Only {len(executed_defers)} of " | ||||
|                 f"1000 defers executed. Missing IDs: " | ||||
|                 f"{sorted(set(range(1000)) - executed_defers)[:10]}..." | ||||
|             ) | ||||
|  | ||||
|         # Verify all defers executed | ||||
| @@ -130,5 +132,6 @@ async def test_defer_stress( | ||||
|  | ||||
|         # If we got here without crashing and with proper ordering, the test passed | ||||
|         assert True, ( | ||||
|             "Test completed successfully - all 1000 defers executed with FIFO ordering preserved" | ||||
|             "Test completed successfully - all 1000 defers executed with " | ||||
|             "FIFO ordering preserved" | ||||
|         ) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user