惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

有赞技术团队
有赞技术团队
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
IT之家
IT之家
博客园 - 【当耐特】
罗磊的独立博客
Stack Overflow Blog
Stack Overflow Blog
MyScale Blog
MyScale Blog
WordPress大学
WordPress大学
The GitHub Blog
The GitHub Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Hugging Face - Blog
Hugging Face - Blog
I
InfoQ
B
Blog RSS Feed
腾讯CDC
云风的 BLOG
云风的 BLOG
N
Netflix TechBlog - Medium
Apple Machine Learning Research
Apple Machine Learning Research
GbyAI
GbyAI
雷峰网
雷峰网
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
D
DataBreaches.Net
The Cloudflare Blog
V
V2EX
S
SegmentFault 最新的问题

Recent Commits to openclaw:main

test: merge chat side-result checks · openclaw/openclaw@ddd2c2a test: merge cron history checks · openclaw/openclaw@f7eb746 test: merge responsive navigation shell checks · openclaw/openclaw@c2e4b47 docs(changelog): add codex oauth fixes · openclaw/openclaw@628e6cd test: merge navigation routing cases · openclaw/openclaw@5d8cecb Tests: mock channel registry bundled fallback · openclaw/openclaw@2b08233 Secrets: avoid broad web search discovery for single plugin config · openclaw/openclaw@a464f59 test: merge config view browser checks · openclaw/openclaw@20cf511 fix(status): align oauth health with runtime · openclaw/openclaw@eed7116 feat: add macOS screen snapshots for monitor preview (#67954) thanks … · openclaw/openclaw@f377db1 fix: report shared auth scopes in hello-ok (#67810) thanks @BunsDev · openclaw/openclaw@0b6c39b Auto-reply: avoid eager bundled route fallback · openclaw/openclaw@3ea1bf4 Tests: narrow session binding contract setup · openclaw/openclaw@54e4e16 fix(macOS): enable undo/redo in webchat composer text input (#34962) · openclaw/openclaw@00951dc Tests: speed up channel setup promotion · openclaw/openclaw@82b529a Docs: refresh agent instructions · openclaw/openclaw@5775fe2 fix(auth): serialize OAuth refresh across agents to fix #26322 (#67876) · openclaw/openclaw@8e79080 test: allow ollama public surface boundary test · openclaw/openclaw@7d4f1a6 Docs: add test performance guardrails · openclaw/openclaw@89706d3 Tests: restore context-engine usage proof · openclaw/openclaw@e4c4f95 Tests: slim context engine runtime coverage · openclaw/openclaw@74c198f ci: retry failed custom checkouts · openclaw/openclaw@0ee5baf test: trim duplicate provider auth onboarding cases · openclaw/openclaw@1ffc02e matrix: fix sessions_spawn --thread subagent session spawning (#67643) · openclaw/openclaw@1ce2596 test: reduce auth choice fixture churn · openclaw/openclaw@857b9cd test: mock health status config boundaries · openclaw/openclaw@9d5ab4a test: mock onboard config io boundary · openclaw/openclaw@299694d test: mock legacy state plugin boundaries · openclaw/openclaw@2713089 test: mock channel install boundaries · openclaw/openclaw@b945248 test: mock doctor preview channel boundaries · openclaw/openclaw@b1a3ad4
fix(qa-lab): handle gateway child spawn errors · openclaw...
vincentkoc · 2026-06-20 · via Recent Commits to openclaw:main
Original file line numberDiff line numberDiff line change

@@ -134,6 +134,32 @@ describe("buildQaRuntimeEnv", () => {

134134

await expect(readdir(tempParent)).resolves.toStrictEqual([]);

135135

});

136136
137+

it("reports command spawn errors instead of leaking unhandled child errors", async () => {

138+

const tempParent = await mkdtemp(path.join(os.tmpdir(), "qa-gateway-spawn-fail-"));

139+

cleanups.push(async () => {

140+

await rm(tempParent, { recursive: true, force: true });

141+

});

142+

qaTempPathState.preferredTmpDir = tempParent;

143+

const missingExecutable = path.join(tempParent, "missing-openclaw-node");

144+
145+

await expect(

146+

startQaGatewayChild({

147+

repoRoot: process.cwd(),

148+

command: {

149+

executablePath: missingExecutable,

150+

usePackagedPlugins: true,

151+

},

152+

transport: {

153+

requiredPluginIds: [],

154+

createGatewayConfig: () => ({}),

155+

},

156+

transportBaseUrl: "http://127.0.0.1:43123",

157+

}),

158+

).rejects.toThrow(/gateway failed to spawn: .*ENOENT/u);

159+
160+

await expect(readdir(tempParent)).resolves.toStrictEqual([]);

161+

});

162+
137163

it("keeps the slow-reply QA opt-out enabled under fast mode", () => {

138164

const env = buildQaRuntimeEnv({

139165

...createParams(),

Original file line numberDiff line numberDiff line change

@@ -279,6 +279,20 @@ function createQaGatewayChildLogCollector() {

279279

};

280280

}

281281
282+

function monitorQaGatewayChildSpawnError(

283+

child: ChildProcess,

284+

output: { push(chunk: Buffer): void },

285+

) {

286+

let spawnError: unknown = null;

287+

child.once("error", (error) => {

288+

spawnError = error;

289+

output.push(

290+

Buffer.from(`[qa-lab] gateway child process error: ${formatErrorMessage(error)}\n`),

291+

);

292+

});

293+

return () => spawnError;

294+

}

295+
282296

async function fetchLocalGatewayHealth(params: {

283297

baseUrl: string;

284298

healthPath: "/readyz" | "/healthz";

@@ -487,10 +501,19 @@ async function waitForGatewayReady(params: {

487501

exitCode: number | null;

488502

signalCode: NodeJS.Signals | null;

489503

};

504+

getSpawnError?: () => unknown;

490505

timeoutMs?: number;

491506

}) {

492507

const startedAt = Date.now();

493508

while (Date.now() - startedAt < (params.timeoutMs ?? 60_000)) {

509+

const spawnError = params.getSpawnError?.();

510+

if (spawnError) {

511+

throw new QaSuiteInfraError(

512+

"gateway_startup_unhealthy",

513+

`gateway failed to spawn: ${formatErrorMessage(spawnError)}\n${params.logs()}`,

514+

{ cause: spawnError },

515+

);

516+

}

494517

if (params.child.exitCode !== null || params.child.signalCode !== null) {

495518

throw new QaSuiteInfraError(

496519

"gateway_startup_unhealthy",

@@ -768,12 +791,14 @@ export async function startQaGatewayChild(params: {

768791

stderrLog.write(buffer);

769792

});

770793

child = attemptChild;

794+

const getAttemptSpawnError = monitorQaGatewayChildSpawnError(attemptChild, output);

771795
772796

try {

773797

await waitForGatewayReady({

774798

baseUrl,

775799

logs,

776800

child: attemptChild,

801+

getSpawnError: getAttemptSpawnError,

777802

timeoutMs: 120_000,

778803

});

779804

const attemptRpcClient = await startQaGatewayRpcClient({

@@ -805,6 +830,7 @@ export async function startQaGatewayChild(params: {

805830

baseUrl,

806831

logs,

807832

child: attemptChild,

833+

getSpawnError: getAttemptSpawnError,

808834

timeoutMs: QA_GATEWAY_CHILD_RPC_RETRY_HEALTH_TIMEOUT_MS,

809835

});

810836

}

@@ -871,12 +897,14 @@ export async function startQaGatewayChild(params: {

871897

output.push(buffer);

872898

stderrLog.write(buffer);

873899

});

900+

const getNextSpawnError = monitorQaGatewayChildSpawnError(nextChild, output);

874901
875902

try {

876903

await waitForGatewayReady({

877904

baseUrl,

878905

logs,

879906

child: nextChild,

907+

getSpawnError: getNextSpawnError,

880908

timeoutMs: 120_000,

881909

});

882910

const nextRpcClient = await startQaGatewayRpcClient({

@@ -908,6 +936,7 @@ export async function startQaGatewayChild(params: {

908936

baseUrl,

909937

logs,

910938

child: nextChild,

939+

getSpawnError: getNextSpawnError,

911940

timeoutMs: 15_000,

912941

});

913942

}