mirror of
https://github.com/esphome/esphome.git
synced 2025-08-05 18:07:47 +00:00
Merge remote-tracking branch 'upstream/heap_scheduler_stress_component' into heap_scheduler_stress_component
This commit is contained in:
commit
37ffd64b48
@ -52,10 +52,16 @@ void SchedulerBulkCleanupComponent::trigger_bulk_cleanup() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Also schedule some normal timeouts to ensure scheduler keeps working after cleanup
|
// Also schedule some normal timeouts to ensure scheduler keeps working after cleanup
|
||||||
|
static int post_cleanup_count = 0;
|
||||||
for (int i = 0; i < 5; i++) {
|
for (int i = 0; i < 5; i++) {
|
||||||
std::string name = "post_cleanup_" + std::to_string(i);
|
std::string name = "post_cleanup_" + std::to_string(i);
|
||||||
App.scheduler.set_timeout(this, name, 50 + i * 25,
|
App.scheduler.set_timeout(this, name, 50 + i * 25, [i]() {
|
||||||
[i]() { ESP_LOGI(TAG, "Post-cleanup timeout %d executed correctly", i); });
|
ESP_LOGI(TAG, "Post-cleanup timeout %d executed correctly", i);
|
||||||
|
post_cleanup_count++;
|
||||||
|
if (post_cleanup_count >= 5) {
|
||||||
|
ESP_LOGI(TAG, "All post-cleanup timeouts completed - test finished");
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -64,14 +64,13 @@ async def test_scheduler_bulk_cleanup(
|
|||||||
match = re.search(r"Post-cleanup timeout (\d+) executed correctly", line)
|
match = re.search(r"Post-cleanup timeout (\d+) executed correctly", line)
|
||||||
if match:
|
if match:
|
||||||
post_cleanup_executed += 1
|
post_cleanup_executed += 1
|
||||||
# All 5 post-cleanup timeouts have executed
|
|
||||||
if post_cleanup_executed >= 5 and not test_complete_future.done():
|
|
||||||
test_complete_future.set_result(None)
|
|
||||||
|
|
||||||
# Check for bulk cleanup completion (but don't end test yet)
|
# Check for final test completion
|
||||||
if "Bulk cleanup test complete" in line:
|
if (
|
||||||
# This just means the interval finished, not that all timeouts executed
|
"All post-cleanup timeouts completed - test finished" in line
|
||||||
pass
|
and not test_complete_future.done()
|
||||||
|
):
|
||||||
|
test_complete_future.set_result(None)
|
||||||
|
|
||||||
async with (
|
async with (
|
||||||
run_compiled(yaml_config, line_callback=on_log_line),
|
run_compiled(yaml_config, line_callback=on_log_line),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user