diff --git a/package-lock.json b/package-lock.json index b6f9588..2897dd1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,7 +11,7 @@ "dependencies": { "@qiwi/deep-proxy": "^3.0.0", "@types/ip": "^1.1.3", - "@types/node": "^20.11.30", + "@types/node": "^20.12.5", "@types/semver": "^7.5.8", "globby-cp": "^1.3.0", "ini": "^4.1.2", @@ -21,7 +21,7 @@ "semver": "^7.6.0", "ssri": "^10.0.5", "tempy": "^3.1.0", - "zx": "7.2.3-dev.0844b88" + "zx": "8.0.0" }, "bin": { "zx-extra": "src/main/js/cli.mjs" @@ -187,9 +187,9 @@ } }, "node_modules/@types/node": { - "version": "20.12.2", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.12.2.tgz", - "integrity": "sha512-zQ0NYO87hyN6Xrclcqp7f8ZbXNbRfoGWNcMvHTPQp9UUrwI0mI7XBz+cu7/W6/VClYo2g63B0cjull/srU7LgQ==", + "version": "20.12.5", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.12.5.tgz", + "integrity": "sha512-BD+BjQ9LS/D8ST9p5uqBxghlN+S42iuNxjsUGjeZobe/ciXzk2qb1B6IXc6AnRLS+yFJRpN2IPEHMzwspfDJNw==", "dependencies": { "undici-types": "~5.26.4" } @@ -1628,9 +1628,9 @@ } }, "node_modules/zx": { - "version": "7.2.3-dev.0844b88", - "resolved": "https://registry.npmjs.org/zx/-/zx-7.2.3-dev.0844b88.tgz", - "integrity": "sha512-+PpsWDmRV8CAhU29pFgFTSRdo9olhIJvrv5ItPIC4U+BsqdMrumIFXrMeoB8XEABlCJBi5DjH/nFxiBgVe+rpg==", + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/zx/-/zx-8.0.0.tgz", + "integrity": "sha512-td4Irxh+i+O8waolUHZyHLSMFALMBWTNVKBk1q5NsvP1vxRqj9JJRGPh6YjKZUTbZZ8uGD1mQLyU9mDr40wR6w==", "bin": { "zx": "build/cli.js" }, @@ -1639,7 +1639,7 @@ }, "optionalDependencies": { "@types/fs-extra": "^11.0.4", - "@types/node": ">=20.11.30" + "@types/node": ">=20.12.4" } } } diff --git a/package.json b/package.json index 928a2e0..f7f7391 100644 --- a/package.json +++ b/package.json @@ -40,7 +40,7 @@ "dependencies": { "@qiwi/deep-proxy": "^3.0.0", "@types/ip": "^1.1.3", - "@types/node": "^20.11.30", + "@types/node": "^20.12.5", "@types/semver": "^7.5.8", "globby-cp": "^1.3.0", "ini": "^4.1.2", @@ -50,7 +50,7 @@ "semver": "^7.6.0", "ssri": "^10.0.5", "tempy": "^3.1.0", - "zx": "7.2.3-dev.0844b88" + "zx": "8.0.0" }, "devDependencies": { "c8": "^9.1.0" diff --git a/src/test/js/test.mjs b/src/test/js/test.mjs index 53669ce..2ca531e 100644 --- a/src/test/js/test.mjs +++ b/src/test/js/test.mjs @@ -12,7 +12,8 @@ import { fs, path, SSRI, - INI + INI, + ps, } from '../../main/js/index.mjs' // $.verbose @@ -109,14 +110,23 @@ password = dbpassword { const SIGNAL = 'SIGTERM' const nothrow = createHook({nothrow: true}, 'nothrow') - const quiet = createHook({ verbose: 0 }, 'quiet') + const quiet = createHook({ verbose: 0, quiet: true }, 'quiet') const debug = createHook({ verbose: 2 }, 'debug') const timeout = createHook( null, 'timeout', (p, t, signal) => { if (!t) return p - let timer = setTimeout(() => p.kill(signal), t) + let timer = setTimeout(() => { + (async () => { + const list = await ps.tree({ pid: p.child.pid, recursive: true }) + for (const l of list) { + process.kill(+l.pid) + } + process.kill(+p.child.pid, signal) + })() + // p.kill(signal) + }, t) p.finally(() => clearTimeout(timer))