mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-12 21:53:00 -06:00
test: remove SIGTERM fixture readiness race (#110283)
This commit is contained in:
committed by
GitHub
parent
d2e07d89ae
commit
0e3afe62c6
@@ -968,6 +968,10 @@ function writeFakePnpm(filePath: string): void {
|
||||
" fs.writeFileSync(process.env.OPENCLAW_FAKE_PNPM_ARGS_PATH, JSON.stringify(process.argv.slice(2)));",
|
||||
" process.exit(0);",
|
||||
"}",
|
||||
'process.on("SIGTERM", () => {',
|
||||
' fs.writeFileSync(process.env.OPENCLAW_FAKE_PNPM_SIGNALED_PATH, "SIGTERM");',
|
||||
" process.exit(0);",
|
||||
"});",
|
||||
"if (process.env.OPENCLAW_FAKE_PNPM_DESCENDANT_PID_PATH) {",
|
||||
" const child = spawn(process.execPath, [",
|
||||
' "-e",',
|
||||
@@ -975,11 +979,8 @@ function writeFakePnpm(filePath: string): void {
|
||||
" ], { stdio: 'ignore' });",
|
||||
" fs.writeFileSync(process.env.OPENCLAW_FAKE_PNPM_DESCENDANT_PID_PATH, String(child.pid));",
|
||||
"}",
|
||||
"// Publishing the PID marks the fixture ready for SIGTERM delivery.",
|
||||
"fs.writeFileSync(process.env.OPENCLAW_FAKE_PNPM_PID_PATH, String(process.pid));",
|
||||
'process.on("SIGTERM", () => {',
|
||||
' fs.writeFileSync(process.env.OPENCLAW_FAKE_PNPM_SIGNALED_PATH, "SIGTERM");',
|
||||
" process.exit(0);",
|
||||
"});",
|
||||
"setInterval(() => {}, 1000);",
|
||||
"",
|
||||
].join("\n"),
|
||||
|
||||
Reference in New Issue
Block a user