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

推荐订阅源

C
Check Point Blog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
博客园 - 聂微东
月光博客
月光博客
博客园 - 司徒正美
爱范儿
爱范儿
aimingoo的专栏
aimingoo的专栏
量子位
Recent Announcements
Recent Announcements
V
V2EX
P
Proofpoint News Feed
小众软件
小众软件
云风的 BLOG
云风的 BLOG
腾讯CDC
宝玉的分享
宝玉的分享
Microsoft Azure Blog
Microsoft Azure Blog
大猫的无限游戏
大猫的无限游戏
Vercel News
Vercel News
The GitHub Blog
The GitHub Blog
A
About on SuperTechFans
B
Blog
博客园_首页
GbyAI
GbyAI
博客园 - Franky

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(e2e): stop interrupted docker builds · openclaw/openc...
vincentkoc · 2026-06-03 · via Recent Commits to openclaw:main
1-

import { execFileSync } from "node:child_process";

1+

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

22

import {

33

chmodSync,

4+

existsSync,

45

mkdtempSync,

56

mkdirSync,

67

readdirSync,

@@ -10,6 +11,7 @@ import {

1011

} from "node:fs";

1112

import { tmpdir } from "node:os";

1213

import { join } from "node:path";

14+

import { setTimeout as delay } from "node:timers/promises";

1315

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

14161517

const HELPER_PATH = "scripts/lib/docker-build.sh";

@@ -293,6 +295,105 @@ output="$(docker_build_run e2e-build -t demo-image .)"

293295

}

294296

});

295297298+

it("stops the tracked build command without retrying when interrupted", async () => {

299+

const workDir = mkdtempSync(join(tmpdir(), "openclaw-docker-build-signal-"));

300+301+

try {

302+

const binDir = join(workDir, "bin");

303+

mkdirSync(binDir);

304+

writeFileSync(

305+

join(binDir, "docker"),

306+

`#!/bin/bash

307+

set -euo pipefail

308+

count=0

309+

if [ -f "$TMPDIR/docker-count" ]; then

310+

count="$(<"$TMPDIR/docker-count")"

311+

fi

312+

count="$((count + 1))"

313+

printf '%s\\n' "$count" >"$TMPDIR/docker-count"

314+

printf '%s\\n' "$$" >"$TMPDIR/docker.pid"

315+

printf 'rpc error: code = Unavailable\\n'

316+

trap 'printf "term\\n" >"$TMPDIR/docker.term"; exit 0' TERM

317+

while true; do

318+

/bin/sleep 1

319+

done

320+

`,

321+

);

322+

chmodSync(join(binDir, "docker"), 0o755);

323+

const rootDir = process.cwd();

324+

writeFileSync(

325+

join(workDir, "runner.sh"),

326+

`#!/bin/bash

327+

set -euo pipefail

328+

ROOT_DIR=${shellQuote(rootDir)}

329+

TMPDIR=${shellQuote(workDir)}

330+

export ROOT_DIR TMPDIR

331+

export PATH="$TMPDIR/bin:$PATH"

332+

export OPENCLAW_DOCKER_BUILD_RETRIES=3

333+

source "$ROOT_DIR/scripts/lib/docker-build.sh"

334+

docker_build_run e2e-build -t demo-image .

335+

`,

336+

);

337+

chmodSync(join(workDir, "runner.sh"), 0o755);

338+339+

const waitForFile = async (filePath: string) => {

340+

for (let attempt = 0; attempt < 50; attempt += 1) {

341+

if (existsSync(filePath)) {

342+

return;

343+

}

344+

await delay(100);

345+

}

346+

throw new Error(`file was not written: ${filePath}`);

347+

};

348+

const waitForExit = async (child: ReturnType<typeof spawn>) =>

349+

await new Promise<{ code: number | null; signal: NodeJS.Signals | null }>((resolve) => {

350+

child.once("exit", (code, signal) => resolve({ code, signal }));

351+

});

352+

const waitForDead = async (pid: number) => {

353+

for (let attempt = 0; attempt < 50; attempt += 1) {

354+

try {

355+

process.kill(pid, 0);

356+

} catch {

357+

return;

358+

}

359+

await delay(100);

360+

}

361+

throw new Error(`process stayed alive: ${pid}`);

362+

};

363+

const runInterruptedBuild = async (signal: NodeJS.Signals, expectedCode: number) => {

364+

rmSync(join(workDir, "docker.pid"), { force: true });

365+

rmSync(join(workDir, "docker.term"), { force: true });

366+

rmSync(join(workDir, "docker-count"), { force: true });

367+

const runner = spawn(join(workDir, "runner.sh"), {

368+

env: { ...process.env, TMPDIR: workDir },

369+

stdio: "ignore",

370+

});

371+

try {

372+

const pidPath = join(workDir, "docker.pid");

373+

await waitForFile(pidPath);

374+

const buildPid = Number.parseInt(readFileSync(pidPath, "utf8"), 10);

375+376+

runner.kill(signal);

377+

const exit = await waitForExit(runner);

378+379+

expect(exit).toEqual({ code: expectedCode, signal: null });

380+

await waitForFile(join(workDir, "docker.term"));

381+

expect(readFileSync(join(workDir, "docker-count"), "utf8").trim()).toBe("1");

382+

await waitForDead(buildPid);

383+

} finally {

384+

if (runner.exitCode === null && runner.signalCode === null) {

385+

runner.kill("SIGKILL");

386+

}

387+

}

388+

};

389+390+

await runInterruptedBuild("SIGTERM", 143);

391+

await runInterruptedBuild("SIGINT", 130);

392+

} finally {

393+

rmSync(workDir, { recursive: true, force: true });

394+

}

395+

});

396+296397

it("does not delay fast successful centralized Docker builds until the next heartbeat", () => {

297398

const workDir = mkdtempSync(join(tmpdir(), "openclaw-docker-build-fast-heartbeat-"));

298399