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

推荐订阅源

Google DeepMind News
Google DeepMind News
B
Blog RSS Feed
量子位
aimingoo的专栏
aimingoo的专栏
V
Visual Studio Blog
Y
Y Combinator Blog
Vercel News
Vercel News
云风的 BLOG
云风的 BLOG
宝玉的分享
宝玉的分享
Engineering at Meta
Engineering at Meta
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
GbyAI
GbyAI
人人都是产品经理
人人都是产品经理
博客园 - 叶小钗
Stack Overflow Blog
Stack Overflow Blog
大猫的无限游戏
大猫的无限游戏
Microsoft Security Blog
Microsoft Security Blog
B
Blog
Last Week in AI
Last Week in AI
有赞技术团队
有赞技术团队
博客园 - 聂微东
腾讯CDC
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
J
Java Code Geeks

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
test: dedupe gateway benchmark teardown tests · openclaw/...
vincentkoc · 2026-05-29 · via Recent Commits to openclaw:main
11

import { spawnSync } from "node:child_process";

2-

import { EventEmitter } from "node:events";

32

import fs from "node:fs";

43

import { createServer } from "node:http";

54

import os from "node:os";

65

import path from "node:path";

76

import { performance } from "node:perf_hooks";

8-

import { describe, expect, it, vi } from "vitest";

7+

import { describe, expect, it } from "vitest";

98

import { testing } from "../../scripts/bench-gateway-restart.ts";

9+

import { registerStopChildBehaviorTests } from "./bench-gateway-child-test-support.js";

10101111

describe("gateway restart benchmark script", () => {

1212

it("prints help without running benchmark cases", () => {

@@ -211,90 +211,9 @@ node 1234 user 12u IPv4 0t0 TCP localhost:1234

211211

expect(testing.resolveRestartDeadlineFailure(true)).toBe("restart_child_exited");

212212

});

213213214-

it("classifies queued child exits before sending teardown signals", async () => {

215-

const child = new EventEmitter() as EventEmitter & {

216-

exitCode: number | null;

217-

kill: ReturnType<typeof vi.fn>;

218-

signalCode: NodeJS.Signals | null;

219-

};

220-

child.exitCode = null;

221-

child.signalCode = null;

222-

child.kill = vi.fn(() => true);

223-224-

const stopped = testing.stopChild(child as unknown as Parameters<typeof testing.stopChild>[0]);

225-

queueMicrotask(() => {

226-

child.exitCode = 0;

227-

child.emit("exit", 0, null);

228-

});

229-230-

await expect(stopped).resolves.toEqual({

231-

exitedBeforeTeardown: true,

232-

exitCode: 0,

233-

signal: null,

234-

});

235-

expect(child.kill).not.toHaveBeenCalled();

236-

});

237-238-

it("classifies failed teardown signaling as a pre-teardown child exit", async () => {

239-

const child = new EventEmitter() as EventEmitter & {

240-

exitCode: number | null;

241-

kill: ReturnType<typeof vi.fn>;

242-

signalCode: NodeJS.Signals | null;

243-

};

244-

child.exitCode = null;

245-

child.signalCode = null;

246-

child.kill = vi.fn(() => {

247-

setImmediate(() => {

248-

child.exitCode = 8;

249-

child.emit("exit", 8, null);

250-

});

251-

return false;

252-

});

253-254-

await expect(

255-

testing.stopChild(child as unknown as Parameters<typeof testing.stopChild>[0]),

256-

).resolves.toEqual({

257-

exitedBeforeTeardown: true,

258-

exitCode: 8,

259-

signal: null,

260-

});

261-

expect(child.kill).toHaveBeenCalledWith("SIGTERM");

262-

});

263-264-

it("bounds teardown when the child ignores termination signals", async () => {

265-

const child = new EventEmitter() as EventEmitter & {

266-

exitCode: number | null;

267-

kill: ReturnType<typeof vi.fn>;

268-

signalCode: NodeJS.Signals | null;

269-

stderr: { destroy: ReturnType<typeof vi.fn> };

270-

stdin: { destroy: ReturnType<typeof vi.fn> };

271-

stdout: { destroy: ReturnType<typeof vi.fn> };

272-

unref: ReturnType<typeof vi.fn>;

273-

};

274-

child.exitCode = null;

275-

child.signalCode = null;

276-

child.kill = vi.fn(() => true);

277-

child.stderr = { destroy: vi.fn() };

278-

child.stdin = { destroy: vi.fn() };

279-

child.stdout = { destroy: vi.fn() };

280-

child.unref = vi.fn();

281-282-

await expect(

283-

testing.stopChild(child as unknown as Parameters<typeof testing.stopChild>[0], {

284-

killGraceMs: 1,

285-

teardownGraceMs: 1,

286-

}),

287-

).resolves.toEqual({

288-

exitedBeforeTeardown: false,

289-

exitCode: null,

290-

signal: "SIGKILL",

291-

});

292-

expect(child.kill).toHaveBeenNthCalledWith(1, "SIGTERM");

293-

expect(child.kill).toHaveBeenNthCalledWith(2, "SIGKILL");

294-

expect(child.stdin.destroy).toHaveBeenCalledOnce();

295-

expect(child.stdout.destroy).toHaveBeenCalledOnce();

296-

expect(child.stderr.destroy).toHaveBeenCalledOnce();

297-

expect(child.unref).toHaveBeenCalledOnce();

214+

registerStopChildBehaviorTests({

215+

stopChild: testing.stopChild,

216+

queuedExitCode: 0,

298217

});

299218300219

it("marks clean and signaled pre-teardown child exits as benchmark failures", () => {