fix(process): retain provider output until streams close (#928)

This commit is contained in:
morluto
2026-10-07 18:39:10 +08:00
committed by GitHub
parent f826aa893f
commit b9292516f4
5 changed files with 149 additions and 6 deletions
+4 -4
View File
@@ -123,7 +123,7 @@ export const runLinuxPrivateDisplayProbe: LinuxPrivateDisplayProbeRunner =
cleanup: () => cleanupOwnedProcessGroup(started.ownership),
};
const supervisor = new ProviderProcessSupervisor(launch);
const outcome = await waitForProbeExit(
const outcome = await waitForProbeOutputClose(
supervisor,
options.timeoutMs,
options.signal,
@@ -300,7 +300,7 @@ const emptyProcessResult = (
cleanupIncomplete: false,
});
const waitForProbeExit = async (
const waitForProbeOutputClose = async (
supervisor: ProviderProcessSupervisor,
timeoutMs: number,
signal: AbortSignal | undefined,
@@ -316,8 +316,8 @@ const waitForProbeExit = async (
try {
return await Promise.race([
supervisor
.waitForExit(Math.max(1, timeoutMs))
.then((exited): "exit" | "timeout" => (exited ? "exit" : "timeout")),
.waitForOutputClose(Math.max(1, timeoutMs))
.then((closed): "exit" | "timeout" => (closed ? "exit" : "timeout")),
aborted,
]);
} finally {