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

推荐订阅源

G
Google Developers Blog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
WordPress大学
WordPress大学
阮一峰的网络日志
阮一峰的网络日志
V
Visual Studio Blog
雷峰网
雷峰网
博客园_首页
The Cloudflare Blog
Hugging Face - Blog
Hugging Face - Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
爱范儿
爱范儿
小众软件
小众软件
D
Docker
P
Proofpoint News Feed
B
Blog
Vercel News
Vercel News
B
Blog RSS Feed
U
Unit 42
月光博客
月光博客
The GitHub Blog
The GitHub Blog
Apple Machine Learning Research
Apple Machine Learning Research
Y
Y Combinator Blog
I
InfoQ
Recent Announcements
Recent Announcements

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: bound Codex app-server cleanup waits · openclaw/ope...
steipete · 2026-05-24 · via Recent Commits to openclaw:main

@@ -299,6 +299,41 @@ function mockCall(mock: unknown, label: string, index = 0): unknown[] {

299299

return call;

300300

}

301301302+

async function waitForPromiseForTest<T>(

303+

promise: Promise<T>,

304+

timeoutMs: number,

305+

label: string,

306+

): Promise<T> {

307+

let timer: ReturnType<typeof setTimeout> | undefined;

308+

try {

309+

return await Promise.race([

310+

promise,

311+

new Promise<never>((_resolve, reject) => {

312+

timer = setTimeout(() => reject(new Error(`${label} timed out`)), timeoutMs);

313+

}),

314+

]);

315+

} finally {

316+

if (timer) {

317+

clearTimeout(timer);

318+

}

319+

}

320+

}

321+322+

async function drainPromiseForTest(

323+

promise: Promise<unknown>,

324+

timeoutMs: number,

325+

label: string,

326+

): Promise<void> {

327+

await waitForPromiseForTest(

328+

promise.then(

329+

() => undefined,

330+

() => undefined,

331+

),

332+

timeoutMs,

333+

label,

334+

);

335+

}

336+302337

function openSocket(url: string): Promise<WebSocket> {

303338

return new Promise((resolve, reject) => {

304339

const socket = new WebSocket(url);

@@ -3153,7 +3188,8 @@ describe("runCodexAppServerAttempt", () => {

31533188

params.runtimePlan = createCodexRuntimePlanFixture();

3154318931553190

const run = runCodexAppServerAttempt(params);

3156-

let completed = false;

3191+

void run.catch(() => undefined);

3192+

let runSettled = false;

31573193

let diagnosticsSubscribed = true;

31583194

try {

31593195

await harness.waitForMethod("thread/start", 10_000);

@@ -3213,37 +3249,20 @@ describe("runCodexAppServerAttempt", () => {

32133249

).toHaveLength(1);

32143250

expect(activeDiagnosticToolKeys(diagnosticEvents)).toEqual(new Set());

321532513216-

await harness.notify({

3217-

method: "item/completed",

3218-

params: {

3219-

threadId: "thread-1",

3220-

turnId: "turn-1",

3221-

completedAtMs: Date.now(),

3222-

item: {

3223-

type: "dynamicToolCall",

3224-

id: "call-echo-1",

3225-

namespace: null,

3226-

tool: "echo",

3227-

arguments: {},

3228-

status: "completed",

3229-

contentItems: [{ type: "inputText", text: "echo done" }],

3230-

success: true,

3231-

durationMs: 1,

3232-

},

3233-

},

3234-

});

3235-3236-

await harness.completeTurn({ threadId: "thread-1", turnId: "turn-1" });

3237-

completed = true;

3238-

await run;

3252+

harness.close();

3253+

abortController.abort(new Error("test complete"));

3254+

await drainPromiseForTest(run, 10_000, "Codex diagnostic test run cleanup");

3255+

runSettled = true;

32393256

} finally {

32403257

if (diagnosticsSubscribed) {

32413258

unsubscribeDiagnostics();

32423259

}

3243-

if (!completed) {

3260+

if (!runSettled) {

32443261

harness.close();

32453262

abortController.abort(new Error("test cleanup"));

3246-

await run.catch(() => {});

3263+

await drainPromiseForTest(run, 1_000, "Codex diagnostic test failure cleanup").catch(

3264+

() => undefined,

3265+

);

32473266

}

32483267

}

32493268

});

@@ -3299,7 +3318,7 @@ describe("runCodexAppServerAttempt", () => {

32993318

contentItems: [{ type: "inputText", text: "Background task started." }],

33003319

});

33013320

expect(harness.requests.some((request) => request.method === "turn/interrupt")).toBe(false);

3302-

const result = await run;

3321+

const result = await waitForPromiseForTest(run, 20_000, "Codex terminal dynamic tool run");

33033322

completed = true;

3304332333053324

expect(result.timedOut).toBe(false);

@@ -3321,7 +3340,9 @@ describe("runCodexAppServerAttempt", () => {

33213340

if (!completed) {

33223341

harness.close();

33233342

abortController.abort(new Error("test cleanup"));

3324-

await run.catch(() => {});

3343+

await drainPromiseForTest(run, 1_000, "Codex terminal dynamic tool cleanup").catch(

3344+

() => undefined,

3345+

);

33253346

}

33263347

}

33273348

});