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

推荐订阅源

Hugging Face - Blog
Hugging Face - Blog
Google DeepMind News
Google DeepMind News
云风的 BLOG
云风的 BLOG
WordPress大学
WordPress大学
Vercel News
Vercel News
Apple Machine Learning Research
Apple Machine Learning Research
T
Tailwind CSS Blog
I
InfoQ
小众软件
小众软件
Recent Announcements
Recent Announcements
博客园 - 【当耐特】
The GitHub Blog
The GitHub Blog
大猫的无限游戏
大猫的无限游戏
美团技术团队
T
The Blog of Author Tim Ferriss
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
酷 壳 – CoolShell
酷 壳 – CoolShell
MongoDB | Blog
MongoDB | Blog
V
V2EX
J
Java Code Geeks
有赞技术团队
有赞技术团队
博客园 - 聂微东
B
Blog RSS Feed
博客园 - 司徒正美

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(test): keep report timeout cleanup alive · openclaw/o...
vincentkoc · 2026-06-20 · via Recent Commits to openclaw:main

@@ -3,6 +3,7 @@ import { spawnSync } from "node:child_process";

33

import fs from "node:fs";

44

import os from "node:os";

55

import path from "node:path";

6+

import { pathToFileURL } from "node:url";

67

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

78

import {

89

buildGroupedTestComparison,

@@ -26,6 +27,15 @@ function makeTempDir() {

2627

return fs.mkdtempSync(path.join(os.tmpdir(), "openclaw-test-group-report-"));

2728

}

282930+

function isProcessAlive(pid: number): boolean {

31+

try {

32+

process.kill(pid, 0);

33+

return true;

34+

} catch {

35+

return false;

36+

}

37+

}

38+2939

function writeGroupedReport(filePath: string) {

3040

fs.writeFileSync(

3141

filePath,

@@ -634,6 +644,57 @@ describe("scripts/test-group-report child process guard", () => {

634644

}

635645

});

636646647+

it("keeps the wrapper alive while timed process-group descendants await SIGKILL", () => {

648+

if (process.platform === "win32" || !fs.existsSync("/usr/bin/time")) {

649+

return;

650+

}

651+652+

const tempDir = makeTempDir();

653+

const childPidPath = path.join(tempDir, "child.pid");

654+

const reportModuleUrl = pathToFileURL(path.resolve("scripts/test-group-report.mjs")).href;

655+

let childPid: number | undefined;

656+

try {

657+

const childScript = [

658+

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

659+

"process.on('SIGTERM', () => {});",

660+

"process.on('SIGHUP', () => {});",

661+

`fs.writeFileSync(${JSON.stringify(childPidPath)}, String(process.pid));`,

662+

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

663+

].join("\n");

664+

const runnerScript = [

665+

`import { spawnText } from ${JSON.stringify(reportModuleUrl)};`,

666+

"const result = await spawnText(",

667+

' "/usr/bin/time",',

668+

` [process.execPath, "--eval", ${JSON.stringify(childScript)}],`,

669+

" { cwd: process.cwd(), env: process.env, killGraceMs: 50, timeoutMs: 500 },",

670+

");",

671+

"process.stdout.write(JSON.stringify(result));",

672+

].join("\n");

673+

const result = spawnSync(process.execPath, ["--input-type=module", "--eval", runnerScript], {

674+

cwd: process.cwd(),

675+

encoding: "utf8",

676+

timeout: 5_000,

677+

});

678+

if (fs.existsSync(childPidPath)) {

679+

childPid = Number.parseInt(fs.readFileSync(childPidPath, "utf8"), 10);

680+

}

681+682+

expect(result.status).toBe(0);

683+

expect(result.stdout).not.toBe("");

684+

const parsed = JSON.parse(result.stdout) as Awaited<ReturnType<typeof spawnText>>;

685+

expect(parsed).toMatchObject({

686+

status: 1,

687+

timedOut: true,

688+

});

689+

expect(parsed.output).toContain("sending SIGKILL");

690+

} finally {

691+

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

692+

process.kill(childPid, "SIGKILL");

693+

}

694+

fs.rmSync(tempDir, { recursive: true, force: true });

695+

}

696+

});

697+637698

it("streams large child output to a log path without retaining it", async () => {

638699

const tempDir = fs.mkdtempSync(path.join(os.tmpdir(), "openclaw-test-group-report-log-"));

639700

const logPath = path.join(tempDir, "child.log");