R17 — run-e2e.sh installs no trap; an interrupted sweep leaks the emulator, the AVD, and port 5560 #26

Closed
opened 2026-08-23 03:44:48 +00:00 by JMR-dev · 1 comment
JMR-dev commented 2026-08-23 03:44:48 +00:00 (Migrated from github.com)

Finding R17 from the overnight max-effort review (Fable lead, Opus sub-agents). Full report: scratchpad/overnight/REVIEW.md.

R17 — run-e2e.sh installs no trap; an interrupted sweep leaks the emulator, the AVD, and port 5560

severity: medium
verdict: CONFIRMED
where: tools/local-emulator/run-e2e.sh — main :153-201/:293-297, branch :222-251/:450-454
scenario: Ctrl-C mid-sweep (longer now: 300s boot + 45s quiet per API 37 leg) leaves headless qemu on console port 5560 and an undeleted lmc_e2e_apiNN AVD. Next run's emulator -port 5560 collides and emu_adb can resolve to the orphan — on a workstation that also has the physical Pixel attached, the exact ambiguity the ANDROID_SERIAL design exists to prevent. LOG_DIR is never cleaned on any path.
evidence: grep -n trap: nothing, either version; stop_emulator called only on the three normal paths.
fix: trap 'stop_emulator; [ "${KEEP_AVD:-0}" = 1 ] || delete_created_avds' EXIT INT TERM, deletion loop factored into a function. Honour KEEP_AVD; keep the emulator log (it lives in LOG_DIR).
risk: EXIT trap ordering vs the summary print; stop_emulator's 30s wait must not delay a user's interrupt.


Cut: above — worked autonomously overnight.

🤖 Generated with Claude Code

_Finding **R17** from the overnight max-effort review (Fable lead, Opus sub-agents). Full report: `scratchpad/overnight/REVIEW.md`._ ### R17 — run-e2e.sh installs no trap; an interrupted sweep leaks the emulator, the AVD, and port 5560 severity: medium verdict: CONFIRMED where: tools/local-emulator/run-e2e.sh — main :153-201/:293-297, branch :222-251/:450-454 scenario: Ctrl-C mid-sweep (longer now: 300s boot + 45s quiet per API 37 leg) leaves headless qemu on console port 5560 and an undeleted lmc_e2e_apiNN AVD. Next run's emulator -port 5560 collides and emu_adb can resolve to the orphan — on a workstation that also has the physical Pixel attached, the exact ambiguity the ANDROID_SERIAL design exists to prevent. LOG_DIR is never cleaned on any path. evidence: grep -n trap: nothing, either version; stop_emulator called only on the three normal paths. fix: trap 'stop_emulator; [ "${KEEP_AVD:-0}" = 1 ] || delete_created_avds' EXIT INT TERM, deletion loop factored into a function. Honour KEEP_AVD; keep the emulator log (it lives in LOG_DIR). risk: EXIT trap ordering vs the summary print; stop_emulator's 30s wait must not delay a user's interrupt. --- **Cut:** `above` — worked autonomously overnight. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
JMR-dev commented 2026-08-23 05:21:32 +00:00 (Migrated from github.com)

Fixed in #47 (merged). Validated with two stub harnesses rather than a sweep — shellcheck is not installed on this host, and no emulator was booted.

Fixed in #47 (merged). Validated with two stub harnesses rather than a sweep — shellcheck is not installed on this host, and no emulator was booted.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: JMR-dev/LibreMediaConverter#26