velxio/backend/app
davidmonterocrespo24 cfde1eb27c fix(ci+esp32): unblock backend e2e + bump frontend node heap
Two CI failures landed after PR #196 (esp32-gpio-matrix-cb-callback)
merged. Both are independent and fixed here together.

1) **Backend E2E: ESP32 hangs at bootloader handoff.**
   PR #196 added picsimlab_gpio_matrix_cb which fires on QEMU's
   iothread. The handler did `_emit({...})` for every routing
   change — and the ESP-IDF bootloader writes to gpio_out_sel
   *hundreds* of times during early boot (each peripheral init
   configures its matrix slot). Each emit acquires _stdout_lock
   and writes to the worker→manager pipe. If the manager drains
   even briefly slow, the pipe fills, write blocks, and the
   iothread stalls — symptom: ESP32 reports `entry 0x400805e4`
   then no Arduino setup() output for 75 s.

   Fix: the iothread callback now ONLY mutates the SignalRouter
   snapshot. It never emits. The 10 Hz poll thread
   (_refresh_signal_routing) stays as the sole emitter, so the
   wire-format event stream is unchanged. Benefit of having the
   callback over poll-only is reduced worst-case routing-emit
   latency (next poll tick vs up to 100 ms) and a warmer
   snapshot dict for cheaper poll diffs.

2) **Frontend Tests: Node OOM at end of suite.**
   117 test files run in one forks-pool worker. Several lazy-load
   the ngspice emscripten module (~30 MB), the MixedModeScheduler
   singleton, and other heavy modules whose dispose hooks aren't
   reached because singletons leak across files. Cumulative heap
   pressure exceeds Node's 4 GB default; the worker hits "Ineffective
   mark-compacts near heap limit" AFTER all 1881 tests pass and
   the OOM kill is reported by vitest as "Worker exited unexpectedly
   / Timeout terminating forks worker". This is not a real test
   failure — every individual test passes.

   Quick fix: pass NODE_OPTIONS=--max-old-space-size=8192 to the
   `npm test` step. Long-term, the singletons should add dispose
   hooks that test fixtures call in afterAll(), or the suite
   should shard into multiple `vitest run --shard` invocations.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-19 16:04:50 +02:00
..
api feat(chips): C-to-Z80 compile via SDCC + LED chaser example 2026-05-19 00:31:10 -03:00
core Refactor code structure for improved readability and maintainability 2026-05-18 21:50:45 -03:00
database refactor(oss-split): remove auth/DB/admin stack from OSS 2026-05-14 13:36:31 -03:00
mcp
models refactor(oss-split): remove auth/DB/admin stack from OSS 2026-05-14 13:36:31 -03:00
schemas refactor(oss-split): remove auth/DB/admin stack from OSS 2026-05-14 13:36:31 -03:00
services fix(ci+esp32): unblock backend e2e + bump frontend node heap 2026-05-19 16:04:50 +02:00
utils refactor(oss-split): remove auth/DB/admin stack from OSS 2026-05-14 13:36:31 -03:00
__init__.py
main.py feat(chips): programmable retro CPU chips with external ROM 2026-05-18 23:38:18 -03:00