Skip to content

fix(avr8js): test-emu hangs after stopping the nodejs-wheel launcher #1694

Closed
FastLED/FastLED
#4895

Description

@zackees

AVR8JS runs firmware correctly under fbuild 2.5.42, but test-emu never returns after a halt marker or emulator timeout when node is the Python entry point installed by nodejs-wheel.

Reproduced from FastLED with:

uv run fbuild test-emu --emulator avr8js --environment uno --timeout 30 --halt-on-success 'Test loop' --expect 'Test setup starting' .build/fbuild/uno

The daemon records both expected markers within one second. The CLI remains blocked. A second run without a matching halt marker remains blocked beyond --timeout 10.

The process tree explains the failure:

fbuild-daemon
  python .venv/bin/node headless.mjs ...
    nodejs_wheel/bin/node headless.mjs ...

run_avr8js_headless kills the launcher with Tokio Child::kill. Native Node survives, is reparented, and holds the inherited stdout/stderr pipes open. The runner waits indefinitely for its line-reader tasks. Manually terminating Node releases the CLI, which reports the already-determined success or timeout result.

Resolution in #1697: discover the absolute native Node executable using node --print process.execPath and launch it directly for headless emulation. Both production entry points use this shared discovery function, so the owned child is the emulator process. Real-Node regressions under FastLED's nodejs-wheel environment cover executable identity and success/error/timeout shutdown. Uno firmware success and timeout runs also finish automatically.

Related historical workaround: FastLED/FastLED#2645 and FastLED/FastLED#2651. Coordinated with FastLED/FastLED#4884.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions