Closed nathanwhit closed 1 day ago
Processing the strace-ops
log shows that these are the pending async ops. I presume one of them ref'd when it's meant to be unref'd?
Map(3) { "op_signal_poll" => 1, "op_spawn_wait" => 1, "op_read" => 2 }
It is not op_signal_poll
, so it must either be op_spawn_wait
or one of the two op_read
ops.
The root cause turned out to be us not implementing the detached
option in child_process.spawn
.
Creating a detached process makes a new process group, which then you can kill with process.kill(-child.pid)
to kill the whole group. Since we hadn't actually detached the process, the kill
call was throwing (because the negative pid signifies the process group, which didn't exist) and playwright was catching the error and didn't have a fallback. So the subprocess was never actually killed.
When using the
webServer
option in a playwright config, the playwright test runner hangs and won't exit withoutCTRL-C
.Repro: https://github.com/nathanwhit/deno-playwright-hang-repro. Run
deno task test