From e69319b5a2eb7179459e7e406837a0c64df8d5b4 Mon Sep 17 00:00:00 2001 From: Eric <5089238+emizzle@users.noreply.github.com> Date: Fri, 7 Mar 2025 16:25:16 +1100 Subject: [PATCH] readd prevention of hanging when closing process streams on windows --- tests/integration/nodeprocess.nim | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/tests/integration/nodeprocess.nim b/tests/integration/nodeprocess.nim index 8c86df3b..2852ea67 100644 --- a/tests/integration/nodeprocess.nim +++ b/tests/integration/nodeprocess.nim @@ -137,10 +137,19 @@ method stop*( error = e.msg writeStackTrace() finally: - trace "closing node process' streams" - await node.process.closeWait() - node.process = nil - trace "node process' streams closed" + proc closeProcessStreams() {.async: (raises: []).} = + trace "closing node process' streams" + await node.process.closeWait() + node.process = nil + trace "node process' streams closed" + + # windows will hang waiting to close process streams, so we can asyncspawn + # in the hopes that it will eventually close them without hanging the + # process + when defined(windows): + asyncSpawn closeProcessStreams() + else: + await closeProcessStreams() proc waitUntilOutput*( node: NodeProcess, output: string