1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-02 11:22:24 +01:00

[scheduler] Fix cancellation of timers with empty string names (#9641)

This commit is contained in:
J. Nick Koston
2025-07-17 16:20:35 -10:00
committed by GitHub
parent eb8a241a01
commit 158a3b2835
5 changed files with 123 additions and 12 deletions

View File

@@ -103,13 +103,14 @@ async def test_scheduler_heap_stress(
# Wait for all callbacks to execute (should be quick, but give more time for scheduling)
try:
await asyncio.wait_for(test_complete_future, timeout=60.0)
await asyncio.wait_for(test_complete_future, timeout=10.0)
except TimeoutError:
# Report how many we got
missing_ids = sorted(set(range(1000)) - executed_callbacks)
pytest.fail(
f"Stress test timed out. Only {len(executed_callbacks)} of "
f"1000 callbacks executed. Missing IDs: "
f"{sorted(set(range(1000)) - executed_callbacks)[:10]}..."
f"{missing_ids[:20]}... (total missing: {len(missing_ids)})"
)
# Verify all callbacks executed