Skip to content

Simulator: nothing drains subprocess stdout/stderr, so a full pipe stalls RPC #11

Description

@jeffory

Problem

tests/e2e/picos_simulator.py's PicosSimulator never reads the simulator subprocess's stdout/stderr pipes after the initial startup handshake (it only reads until it finds the [Socket] TCP port: N line). Once that's done, nothing else drains those pipes.

A chatty app can fill the OS pipe buffer quickly — C-Dogs, for example, emits one stderr line per file op across roughly 2700 SD directory entries during its asset scan, which exceeds the pipe buffer in well under a second. When that happens the simulator process blocks on write() to its own stdout/stderr, and since the RPC socket thread also prints per-request, sustained polling from the test harness stalls entirely — not just log reads, any RPC.

Impact

This isn't specific to C-Dogs — any simulator test running an app that logs enough will hit the same stall. It's a general reliability gap in the e2e harness.

Suggested direction

A working fix already exists in this codebase: start_stdio_drain() in tests/e2e/test_cdogs_memory.py (~line 102) spins up a background reader that continuously drains both pipes. Promote that into PicosSimulator.start() (tests/e2e/picos_simulator.py) so every simulator-based test gets it for free instead of each test file having to remember to wire it up.

Context

Surfaced while implementing Stage 0/1 of the C-Dogs asset-memory redesign (local specs, not tracked in this repo). Parent commits e9b1622e..21a9b389.

Activity

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

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions