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

推荐订阅源

Last Week in AI
Last Week in AI
阮一峰的网络日志
阮一峰的网络日志
P
Proofpoint News Feed
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
MongoDB | Blog
MongoDB | Blog
云风的 BLOG
云风的 BLOG
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
J
Java Code Geeks
WordPress大学
WordPress大学
T
The Blog of Author Tim Ferriss
V
Visual Studio Blog
小众软件
小众软件
Microsoft Azure Blog
Microsoft Azure Blog
博客园_首页
IT之家
IT之家
Vercel News
Vercel News
C
Check Point Blog
Google DeepMind News
Google DeepMind News
月光博客
月光博客
D
DataBreaches.Net
酷 壳 – CoolShell
酷 壳 – CoolShell
美团技术团队
Y
Y Combinator Blog
Hugging Face - Blog
Hugging Face - 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(qa): avoid plugin update registry port collisions · o...
vincentkoc · 2026-06-23 · via Recent Commits to openclaw:main
11

// Plugin Update Unchanged Docker tests cover plugin update unchanged docker script behavior.

2-

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

3-

import { mkdtempSync, readFileSync, rmSync, writeFileSync } from "node:fs";

2+

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

3+

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

44

import { tmpdir } from "node:os";

55

import path from "node:path";

6+

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

67

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

7889

const PLUGIN_UPDATE_DOCKER_SCRIPT = "scripts/e2e/plugin-update-unchanged-docker.sh";

910

const PLUGIN_UPDATE_SCENARIO_SCRIPT = "scripts/e2e/lib/plugin-update/unchanged-scenario.sh";

1011

const CORRUPT_UPDATE_SCENARIO_SCRIPT = "scripts/e2e/lib/plugin-update/corrupt-update-scenario.sh";

1112

const PLUGIN_UPDATE_PROBE_SCRIPT = "scripts/e2e/lib/plugin-update/probe.mjs";

13+

const PLUGIN_UPDATE_REGISTRY_SCRIPT = "scripts/e2e/lib/plugin-update/registry-server.mjs";

1214

const CORRUPT_PLUGIN_ID = "demo-corrupt-plugin";

13151416

function runProbe(command: string, payload: unknown): void {

@@ -58,6 +60,19 @@ function runProbeFileStatus(

5860

return { status: result.status, stderr: result.stderr };

5961

}

606263+

async function waitForPortFile(portFile: string): Promise<number> {

64+

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

65+

if (existsSync(portFile)) {

66+

const port = Number.parseInt(readFileSync(portFile, "utf8"), 10);

67+

if (Number.isInteger(port) && port > 0) {

68+

return port;

69+

}

70+

}

71+

await delay(50);

72+

}

73+

throw new Error("registry did not write a port file");

74+

}

75+6176

describe("plugin update unchanged Docker E2E", () => {

6277

it("seeds current plugin install ledger state before checking config stability", () => {

6378

const runner = readFileSync(PLUGIN_UPDATE_DOCKER_SCRIPT, "utf8");

@@ -78,7 +93,10 @@ describe("plugin update unchanged Docker E2E", () => {

7893

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

79948095

expect(script).toContain("OPENCLAW_PLUGIN_UPDATE_TIMEOUT_SECONDS");

81-

expect(script).toContain("node scripts/e2e/lib/plugin-update/registry-server.mjs");

96+

expect(script).toContain('registry_port_file=/tmp/openclaw-e2e-registry.port');

97+

expect(script).toContain('node scripts/e2e/lib/plugin-update/registry-server.mjs "$registry_port_file"');

98+

expect(script).toContain('export NPM_CONFIG_REGISTRY="http://127.0.0.1:$(cat "$registry_port_file")"');

99+

expect(script).toContain('export npm_config_registry="$NPM_CONFIG_REGISTRY"');

82100

expect(script).toContain(

83101

"openclaw_e2e_read_positive_int_env OPENCLAW_PLUGIN_UPDATE_TIMEOUT_SECONDS 180",

84102

);

@@ -99,6 +117,29 @@ describe("plugin update unchanged Docker E2E", () => {

99117

expect(script).not.toContain("cat /tmp/openclaw-e2e-registry.log");

100118

});

101119120+

it("serves plugin metadata from an ephemeral registry port", async () => {

121+

const root = mkdtempSync(path.join(tmpdir(), "openclaw-plugin-update-registry-"));

122+

const portFile = path.join(root, "registry.port");

123+

const child = spawn("node", [PLUGIN_UPDATE_REGISTRY_SCRIPT, portFile], {

124+

stdio: "ignore",

125+

});

126+

try {

127+

const port = await waitForPortFile(portFile);

128+129+

const response = await fetch(`http://127.0.0.1:${port}/@example%2flossless-claw`);

130+

expect(response.status).toBe(200);

131+

const metadata = (await response.json()) as {

132+

versions?: Record<string, { dist?: { tarball?: string } }>;

133+

};

134+

expect(metadata.versions?.["0.9.0"]?.dist?.tarball).toBe(

135+

`http://127.0.0.1:${port}/@example/lossless-claw/-/lossless-claw-0.9.0.tgz`,

136+

);

137+

} finally {

138+

child.kill("SIGTERM");

139+

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

140+

}

141+

});

142+102143

it("bounds assert-output diagnostics to the saved command log tail", () => {

103144

const root = mkdtempSync(path.join(tmpdir(), "openclaw-plugin-update-probe-"));

104145

const logPath = path.join(root, "plugin-update-output.log");