Repository navigation
fix(examples/Test): busy-wait under Espressif QEMU instead of delay() (#4845) - #4857
Conversation
…#4845) The esp32c3 QEMU 'Test' job hung after 'Test setup starting'. Local repro (4/4 failures): setup() completes and loop() runs ~1 s, then a delay(1) -> vTaskDelay never returns. With delayMicroseconds(1000) the sketch passes 8/8. Probable cause: on a loaded host the emulated timer alarm that wakes the sleeping task is lost. QEMU-only (#if FASTLED_ESP32_IS_QEMU); real boards keep delay(1).
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
Closes #4845. Part of #4844.
Symptom:
esp32c3_qemu_test (Test, Test loop!)timed out on #4841 (run 38822465148, attempt 1) and then passed on rerun. The failure artifact shows the chip booting and printingTest setup starting, but neverTest loop!.Local reproduction: CI's exact staging command plus
fbuild test-emu --timeout 120failed 4 of 4 runs on this host. I added temporary prints to the staged copy only:setup()completes, includinglegacyLibcOnCrgb()anddelay(100).loop()runs for about 1 s of emulated time (for example, pass 500 atmillis()=947), then stops.millis()=1161), and it always follows adelay(1). That is Arduino'sdelay, i.e.vTaskDelay. FastLED'susing fl::delayis compiled in only for the stub build.delay(1)withdelayMicroseconds(1000)passed 3 of 3 runs.Probable cause (consistent with the evidence, not proven): on a loaded host, the emulated timer alarm that wakes the sleeping task is lost, so
vTaskDelaynever returns. Busy-waiting needs no alarm.Fix: QEMU only. Under
FASTLED_ESP32_IS_QEMU, the loop busy-waits withdelayMicroseconds(1000). Real boards keepdelay(1), which yields to the idle task. The test still checks boot,setup(), the loop, andmillis()-drivenEVERY_N_MILLIS.Evidence:
task_wdtadded to the halt-on-error patterns, so busy-waiting doesn't trip the task watchdog.bash compile uno --examples Testandbash compile esp32dev --examples Testsucceed.bash lint: 0.ci-test:qemu*label, so CI runs the QEMU jobs.Summary by CodeRabbit