From ca2cf4044c89b88ed86d4db638533ddf960492d9 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Tue, 17 Mar 2026 00:35:53 -1000 Subject: [PATCH] Fix stray quote in main.cpp and scheduler time overflow - Remove trailing " from AUTO GENERATED INCLUDE BLOCK END comment - Reset scheduler `now` at start of each outer iteration to avoid unbounded growth toward UINT32_MAX across benchmark iterations --- tests/benchmarks/components/main.cpp | 2 +- tests/benchmarks/core/bench_scheduler.cpp | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/tests/benchmarks/components/main.cpp b/tests/benchmarks/components/main.cpp index 02fdf288a5..9bc0c31a15 100644 --- a/tests/benchmarks/components/main.cpp +++ b/tests/benchmarks/components/main.cpp @@ -10,7 +10,7 @@ It replaces the default ESPHome main with a benchmark runner. // Auto generated code by esphome // ========== AUTO GENERATED INCLUDE BLOCK BEGIN =========== -// ========== AUTO GENERATED INCLUDE BLOCK END ===========" +// ========== AUTO GENERATED INCLUDE BLOCK END =========== void original_setup() { // Code-generated App initialization (pre_setup, area/device registration, etc.) diff --git a/tests/benchmarks/core/bench_scheduler.cpp b/tests/benchmarks/core/bench_scheduler.cpp index c32bfebcde..f49b19a626 100644 --- a/tests/benchmarks/core/bench_scheduler.cpp +++ b/tests/benchmarks/core/bench_scheduler.cpp @@ -72,10 +72,9 @@ static void Scheduler_Call_5IntervalsFiring(benchmark::State &state) { } scheduler.process_to_add(); - // Start at a known time so intervals are immediately due - uint32_t now = millis() + 100; - for (auto _ : state) { + // Reset each outer iteration to avoid unbounded growth toward UINT32_MAX + uint32_t now = 100; for (int i = 0; i < kInnerIterations; i++) { scheduler.call(now); // Advance time by 1ms so intervals are due again next call