Skip to content

conformance client --timeout never stops a hung client started through a shell #598

Backlog

Description

@sholub-dev

When the client under test hangs, --timeout doesn't stop it and the runner never returns. On Linux (where /bin/sh is dash) this happens even with a plain command like node client.js.

Repro:

echo 'setInterval(() => {}, 1000)' > hang.js
npm run build
node dist/index.js client --command "node hang.js" --scenario initialize --timeout 3000

Expected: after 3 seconds the runner prints Client timed out after 3000ms, reports the failure and exits.

Actual: output stops at Executing client: node hang.js http://localhost:... and the runner keeps running until it is killed by hand. hang.js is still running afterwards.

Cause: the client is started with shell: true, so the child is sh -c "node hang.js <url>". On timeout the runner calls childProcess.kill(), which only signals sh. The client keeps the output pipes open, so the close event never fires. The same thing happens on any OS for commands the shell doesn't hand off directly, such as cd examples && node client.js or npx tsx client.ts.

Reproducible on main at 96a6f94 (Linux, Node 22).

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions