mirror of
				https://github.com/esphome/esphome.git
				synced 2025-10-31 07:03:55 +00:00 
			
		
		
		
	preen
This commit is contained in:
		| @@ -33,14 +33,18 @@ async def test_defer_stress( | ||||
|     test_complete_future: asyncio.Future[None] = loop.create_future() | ||||
|  | ||||
|     # Track executed defers and their order | ||||
|     executed_defers = set() | ||||
|     thread_executions = {}  # thread_id -> list of indices in execution order | ||||
|     fifo_violations = [] | ||||
|     executed_defers: set[int] = set() | ||||
|     thread_executions: dict[ | ||||
|         int, list[int] | ||||
|     ] = {}  # thread_id -> list of indices in execution order | ||||
|     fifo_violations: list[str] = [] | ||||
|  | ||||
|     def on_log_line(line: str) -> None: | ||||
|         # Track all executed defers with thread and index info | ||||
|         match = re.search(r"Executed defer (\d+) \(thread (\d+), index (\d+)\)", line) | ||||
|         if match: | ||||
|         if not match: | ||||
|             return | ||||
|  | ||||
|         defer_id = int(match.group(1)) | ||||
|         thread_id = int(match.group(2)) | ||||
|         index = int(match.group(3)) | ||||
| @@ -52,10 +56,7 @@ async def test_defer_stress( | ||||
|             thread_executions[thread_id] = [] | ||||
|  | ||||
|         # Check FIFO ordering within thread | ||||
|             if ( | ||||
|                 thread_executions[thread_id] | ||||
|                 and thread_executions[thread_id][-1] >= index | ||||
|             ): | ||||
|         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]}" | ||||
|             ) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user