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

推荐订阅源

MyScale Blog
MyScale Blog
F
Fortinet All Blogs
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
D
Docker
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
爱范儿
爱范儿
V
Visual Studio Blog
Last Week in AI
Last Week in AI
WordPress大学
WordPress大学
aimingoo的专栏
aimingoo的专栏
小众软件
小众软件
L
LangChain Blog
Vercel News
Vercel News
阮一峰的网络日志
阮一峰的网络日志
IT之家
IT之家
P
Proofpoint News Feed
博客园_首页
D
DataBreaches.Net
T
The Blog of Author Tim Ferriss
The GitHub Blog
The GitHub Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
C
Check Point Blog
Engineering at Meta
Engineering at Meta
Microsoft Azure Blog
Microsoft Azure Blog

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(install-smoke): clean Bun timeout child trees · openc...
vincentkoc · 2026-06-20 · via Recent Commits to openclaw:main
11

// Test Install Sh Docker tests cover test install sh docker script behavior.

2-

import { spawnSync } from "node:child_process";

2+

import { spawn, spawnSync } from "node:child_process";

33

import { existsSync, readFileSync } from "node:fs";

44

import path from "node:path";

55

import { runInNewContext } from "node:vm";

@@ -102,6 +102,30 @@ function runDefaultSmokePlatform(env: Record<string, string>, hostArch: string):

102102

return result.stdout;

103103

}

104104105+

async function waitForCondition(

106+

predicate: () => boolean,

107+

label: string,

108+

timeoutMs = 2_000,

109+

): Promise<void> {

110+

const deadlineAt = Date.now() + timeoutMs;

111+

while (Date.now() < deadlineAt) {

112+

if (predicate()) {

113+

return;

114+

}

115+

await new Promise((resolve) => setTimeout(resolve, 25));

116+

}

117+

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

118+

}

119+120+

function isProcessAlive(pid: number): boolean {

121+

try {

122+

process.kill(pid, 0);

123+

return true;

124+

} catch {

125+

return false;

126+

}

127+

}

128+105129

function extractReadPackTarballFilename(): string {

106130

const script = readFileSync(SCRIPT_PATH, "utf8");

107131

const match = script.match(/(read_pack_tarball_filename\(\) \{[\s\S]*?\n\})\n\nSMOKE_IMAGE/u);

@@ -812,6 +836,78 @@ describe("bun global install smoke", () => {

812836

},

813837

);

814838839+

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

840+

"cleans Bun global smoke descendants on parent signal",

841+

async () => {

842+

const tempDir = tempDirs.make("openclaw-bun-global-parent-signal-");

843+

const readyPath = path.join(tempDir, "ready");

844+

const descendantPidPath = path.join(tempDir, "descendant.pid");

845+

let descendantPid = 0;

846+

const descendantScript = [

847+

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

848+

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

849+

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

850+

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

851+

].join("\n");

852+

const parentScript = [

853+

"const childProcess = require('node:child_process');",

854+

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

855+

`childProcess.spawn(process.execPath, ["-e", ${JSON.stringify(descendantScript)}], { stdio: "ignore" });`,

856+

`fs.writeFileSync(${JSON.stringify(readyPath)}, "ready");`,

857+

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

858+

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

859+

].join("\n");

860+

const runner = spawn(

861+

process.execPath,

862+

[

863+

BUN_GLOBAL_ASSERTIONS_PATH,

864+

"run-with-timeout",

865+

"60000",

866+

process.execPath,

867+

"-e",

868+

parentScript,

869+

],

870+

{

871+

env: {

872+

...process.env,

873+

OPENCLAW_BUN_GLOBAL_SMOKE_TIMEOUT_KILL_GRACE_MS: "100",

874+

},

875+

stdio: ["ignore", "pipe", "pipe"],

876+

},

877+

);

878+

const runnerExit = new Promise<{ status: number | null; signal: NodeJS.Signals | null }>(

879+

(resolve) => {

880+

runner.once("exit", (status, signal) => resolve({ status, signal }));

881+

},

882+

);

883+884+

try {

885+

await waitForCondition(

886+

() => existsSync(readyPath) && existsSync(descendantPidPath),

887+

"Bun global smoke descendant readiness",

888+

);

889+

descendantPid = Number.parseInt(readFileSync(descendantPidPath, "utf8"), 10);

890+

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

891+

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

892+893+

runner.kill("SIGTERM");

894+895+

await expect(runnerExit).resolves.toEqual({ status: 143, signal: null });

896+

await waitForCondition(

897+

() => !isProcessAlive(descendantPid),

898+

"Bun global smoke descendant cleanup",

899+

);

900+

} finally {

901+

if (runner.pid && isProcessAlive(runner.pid)) {

902+

process.kill(runner.pid, "SIGKILL");

903+

}

904+

if (descendantPid && isProcessAlive(descendantPid)) {

905+

process.kill(descendantPid, "SIGKILL");

906+

}

907+

}

908+

},

909+

);

910+815911

it("gates workflow Bun install smoke to scheduled and release-check runs", () => {

816912

const workflow = readFileSync(INSTALL_SMOKE_WORKFLOW_PATH, "utf8");

817913

const releaseChecks = readFileSync(RELEASE_CHECKS_WORKFLOW_PATH, "utf8");