Commit Graph

1 Commits

Author SHA1 Message Date
David Montero c147e7a4aa test(esp32): add MicroPython I2C reproduction tests for IWDT bug
Two Node.js tests that hit the simulation backend WebSocket directly
and inject minimal MicroPython programs via raw-paste REPL:

- test_micropython_i2c_minimal: smallest possible repro. I2C(0)+scan+
  single-byte writeto. Used to prove the bug is NOT in the basic I2C
  layer — this test passes both before and after the fix.

- test_micropython_i2c_ssd1306_repro: walks the full SSD1306 init
  sequence (25-cmd init loop + 6x addr writes + writevto 8B + writevto
  1024B). Used to prove the bug is NOT in the cmd sequence or the
  writevto path — this test also passes both before and after.

These two tests refuted the original "missing TRANS_DONE IRQ"
hypothesis and pointed the investigation toward the file-load vs
raw-REPL difference, which led to identifying the per-byte _emit
bottleneck in esp32_worker.py.

Run with:
    node --experimental-websocket test/test_micropython_i2c_minimal/test.mjs \
         --backend=http://localhost:3080 --timeout=120

Requires the velxio container (or local backend with QEMU libs) on
the given backend URL.
2026-05-23 22:27:16 +02:00