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

推荐订阅源

Blog — PlanetScale
Blog — PlanetScale
Y
Y Combinator Blog
G
Google Developers Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
L
LangChain Blog
S
SegmentFault 最新的问题
J
Java Code Geeks
V
Visual Studio Blog
H
Help Net Security
Stack Overflow Blog
Stack Overflow Blog
aimingoo的专栏
aimingoo的专栏
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
T
Tailwind CSS Blog
Microsoft Azure Blog
Microsoft Azure Blog
博客园_首页
H
Hackread – Cybersecurity News, Data Breaches, AI and More
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
博客园 - Franky
B
Blog RSS Feed
The Cloudflare Blog
MyScale Blog
MyScale Blog
月光博客
月光博客
Microsoft Security Blog
Microsoft Security 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
test: require gateway lock acquisitions · openclaw/opencl...
steipete · 2026-05-08 · via Recent Commits to openclaw:main

@@ -10,6 +10,8 @@ import { resolveConfigPath, resolveStateDir } from "../config/paths.js";

1010

import { createSuiteTempRootTracker } from "../test-helpers/temp-dir.js";

1111

import { acquireGatewayLock, GatewayLockError, type GatewayLockOptions } from "./gateway-lock.js";

121213+

type GatewayLock = NonNullable<Awaited<ReturnType<typeof acquireGatewayLock>>>;

14+1315

const fixtureRootTracker = createSuiteTempRootTracker({ prefix: "openclaw-gateway-lock-" });

1416

let fixtureRoot = "";

1517

const realNow = Date.now.bind(Date);

@@ -47,6 +49,14 @@ async function acquireForTest(

4749

});

4850

}

495152+

function expectGatewayLock(lock: Awaited<ReturnType<typeof acquireGatewayLock>>): GatewayLock {

53+

expect(lock).toEqual(expect.objectContaining({ release: expect.any(Function) }));

54+

if (lock === null) {

55+

throw new Error("Expected gateway lock");

56+

}

57+

return lock;

58+

}

59+5060

function resolveLockPath(env: NodeJS.ProcessEnv) {

5161

const stateDir = resolveStateDir(env);

5262

const configPath = resolveConfigPath(env, stateDir);

@@ -175,17 +185,17 @@ describe("gateway lock", () => {

175185

vi.useRealTimers();

176186

const env = await makeEnv();

177187

const lock = await acquireForTest(env, { timeoutMs: 50 });

178-

expect(lock).not.toBeNull();

188+

const acquiredLock = expectGatewayLock(lock);

179189180190

const pending = acquireForTest(env, {

181191

timeoutMs: 15,

182192

readProcessCmdline: () => ["openclaw", "gateway", "run"],

183193

});

184194

await expect(pending).rejects.toBeInstanceOf(GatewayLockError);

185195186-

await lock?.release();

196+

await acquiredLock.release();

187197

const lock2 = await acquireForTest(env);

188-

await lock2?.release();

198+

await expectGatewayLock(lock2).release();

189199

});

190200191201

it("treats recycled linux pid as stale when start time mismatches", async () => {

@@ -204,9 +214,9 @@ describe("gateway lock", () => {

204214

pollIntervalMs: 5,

205215

platform: "linux",

206216

});

207-

expect(lock).not.toBeNull();

217+

const acquiredLock = expectGatewayLock(lock);

208218209-

await lock?.release();

219+

await acquiredLock.release();

210220

spy.mockRestore();

211221

});

212222

@@ -259,8 +269,7 @@ describe("gateway lock", () => {

259269

platform: "darwin",

260270

port: 18789,

261271

});

262-

expect(lock).not.toBeNull();

263-

await lock?.release();

272+

await expectGatewayLock(lock).release();

264273

connectSpy.mockRestore();

265274

});

266275

@@ -329,8 +338,7 @@ describe("gateway lock", () => {

329338

port: 18789,

330339

readProcessCmdline: () => ["chrome.exe", "--no-sandbox"],

331340

});

332-

expect(lock).not.toBeNull();

333-

await lock?.release();

341+

await expectGatewayLock(lock).release();

334342335343

connectSpy.mockRestore();

336344

});

@@ -394,8 +402,7 @@ describe("gateway lock", () => {

394402

port: 18789,

395403

readProcessCmdline: () => ["/Applications/Safari.app/Contents/MacOS/Safari"],

396404

});

397-

expect(lock).not.toBeNull();

398-

await lock?.release();

405+

await expectGatewayLock(lock).release();

399406400407

connectSpy.mockRestore();

401408

});