MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / signal

Function signal

e2e/local/daemon-process.ts:14–26  ·  view source on GitHub ↗
(pid: number, name: NodeJS.Signals)

Source from the content-addressed store, hash-verified

12};
13
14const signal = (pid: number, name: NodeJS.Signals): void => {
15 // Auto-started daemons are detached process-group leaders. Signal the whole
16 // private group so their Vite child cannot survive a failed test.
17 // oxlint-disable-next-line executor/no-try-catch-or-throw -- boundary: Windows and pre-detach failures require a direct-pid fallback
18 try {
19 process.kill(process.platform === "win32" ? pid : -pid, name);
20 } catch {
21 // oxlint-disable-next-line executor/no-try-catch-or-throw -- cleanup tolerates a process that exited between the liveness check and signal
22 try {
23 process.kill(pid, name);
24 } catch {}
25 }
26};
27
28const waitUntilStopped = async (pid: number, timeoutMs: number): Promise<boolean> => {
29 const deadline = performance.now() + timeoutMs;

Callers 1

stopAutoSpawnedDaemonFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected