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

推荐订阅源

V
Visual Studio Blog
Y
Y Combinator Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Hugging Face - Blog
Hugging Face - Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
The Cloudflare Blog
L
LangChain Blog
美团技术团队
N
Netflix TechBlog - Medium
量子位
酷 壳 – CoolShell
酷 壳 – CoolShell
B
Blog
博客园 - 司徒正美
爱范儿
爱范儿
D
DataBreaches.Net
月光博客
月光博客
U
Unit 42
B
Blog RSS Feed
Engineering at Meta
Engineering at Meta
Apple Machine Learning Research
Apple Machine Learning Research
Jina AI
Jina AI
MongoDB | Blog
MongoDB | Blog
腾讯CDC

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): wait for model catalog process groups · open...
vincentkoc · 2026-06-18 · via Recent Commits to openclaw:main
11

// Qa Lab tests cover model catalog plugin behavior.

2+

import fs from "node:fs/promises";

3+

import os from "node:os";

4+

import path from "node:path";

25

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

36

import {

7+

loadQaRunnerModelOptions,

48

parseQaRunnerModelOptionsOutput,

59

selectQaRunnerModelOptions,

610

} from "./model-catalog.runtime.js";

71112+

async function waitForFile(filePath: string, timeoutMs: number): Promise<void> {

13+

const deadlineAt = Date.now() + timeoutMs;

14+

while (Date.now() < deadlineAt) {

15+

try {

16+

await fs.access(filePath);

17+

return;

18+

} catch {

19+

await new Promise((resolvePoll) => {

20+

setTimeout(resolvePoll, 25);

21+

});

22+

}

23+

}

24+

throw new Error(`timed out waiting for ${filePath}`);

25+

}

26+27+

function isProcessAlive(pid: number): boolean {

28+

try {

29+

process.kill(pid, 0);

30+

return true;

31+

} catch {

32+

return false;

33+

}

34+

}

35+36+

async function waitForDead(pid: number, timeoutMs: number): Promise<void> {

37+

const deadlineAt = Date.now() + timeoutMs;

38+

while (Date.now() < deadlineAt) {

39+

if (!isProcessAlive(pid)) {

40+

return;

41+

}

42+

await new Promise((resolvePoll) => {

43+

setTimeout(resolvePoll, 25);

44+

});

45+

}

46+

throw new Error(`timed out waiting for pid ${pid} to exit`);

47+

}

48+849

describe("qa runner model catalog", () => {

950

it("filters to available rows and prefers gpt-5.5 first", () => {

1051

expect(

@@ -58,4 +99,46 @@ describe("qa runner model catalog", () => {

5899

).map((entry) => entry.key),

59100

).toEqual(["openai/gpt-5.5"]);

60101

});

102+103+

it.runIf(process.platform !== "win32")(

104+

"kills aborted catalog process groups when the catalog child exits first",

105+

async () => {

106+

const repoRoot = await fs.mkdtemp(path.join(os.tmpdir(), "openclaw-qa-model-catalog-"));

107+

const pidPath = path.join(repoRoot, "descendant.pid");

108+

let descendantPid: number | undefined;

109+

const controller = new AbortController();

110+

const childScript = "process.on('SIGTERM', () => {}); setInterval(() => {}, 1000);";

111+

const catalogScript = [

112+

"const { spawn } = require('node:child_process');",

113+

"const fs = require('node:fs');",

114+

`const child = spawn(process.execPath, ['-e', ${JSON.stringify(childScript)}], { stdio: 'ignore' });`,

115+

`fs.writeFileSync(${JSON.stringify(pidPath)}, String(child.pid));`,

116+

"process.on('SIGTERM', () => process.exit(0));",

117+

"setInterval(() => {}, 1000);",

118+

].join("\n");

119+120+

try {

121+

await fs.mkdir(path.join(repoRoot, "dist"), { recursive: true });

122+

await fs.writeFile(path.join(repoRoot, "dist", "index.js"), catalogScript, "utf8");

123+

const runPromise = loadQaRunnerModelOptions({

124+

repoRoot,

125+

signal: controller.signal,

126+

});

127+128+

await waitForFile(pidPath, 2_000);

129+

descendantPid = Number.parseInt(await fs.readFile(pidPath, "utf8"), 10);

130+

expect(Number.isInteger(descendantPid)).toBe(true);

131+

expect(isProcessAlive(descendantPid)).toBe(true);

132+

controller.abort();

133+134+

await expect(runPromise).rejects.toThrow("qa model catalog aborted");

135+

await waitForDead(descendantPid, 2_000);

136+

} finally {

137+

if (descendantPid !== undefined && isProcessAlive(descendantPid)) {

138+

process.kill(descendantPid, "SIGKILL");

139+

}

140+

await fs.rm(repoRoot, { force: true, recursive: true });

141+

}

142+

},

143+

);

61144

});