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

推荐订阅源

G
Google Developers Blog
博客园 - 三生石上(FineUI控件)
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
MongoDB | Blog
MongoDB | Blog
小众软件
小众软件
Y
Y Combinator Blog
博客园 - 聂微东
Google DeepMind News
Google DeepMind News
D
Docker
罗磊的独立博客
Microsoft Security Blog
Microsoft Security Blog
D
DataBreaches.Net
B
Blog
Vercel News
Vercel News
Recent Announcements
Recent Announcements
GbyAI
GbyAI
阮一峰的网络日志
阮一峰的网络日志
T
The Blog of Author Tim Ferriss
H
Hackread – Cybersecurity News, Data Breaches, AI and More
P
Proofpoint News Feed
酷 壳 – CoolShell
酷 壳 – CoolShell
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
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
test: catalog stale lock cleanup records · openclaw/openc...
shakkernerd · 2026-05-12 · via Recent Commits to openclaw:main

@@ -33,6 +33,17 @@ async function expectPathMissing(targetPath: string): Promise<void> {

3333

throw new Error(`Expected path to be missing: ${targetPath}`);

3434

}

353536+

function lockCleanupRecords(

37+

locks: Array<{ lockPath: string; removed: boolean; stale: boolean; staleReasons: string[] }>,

38+

) {

39+

return locks.map((entry) => ({

40+

name: path.basename(entry.lockPath),

41+

removed: entry.removed,

42+

stale: entry.stale,

43+

staleReasons: entry.staleReasons,

44+

}));

45+

}

46+3647

async function expectCurrentPidOwnsLock(params: {

3748

sessionFile: string;

3849

timeoutMs: number;

@@ -411,10 +422,39 @@ describe("acquireSessionWriteLock", () => {

411422

});

412423413424

expect(result.locks).toHaveLength(3);

414-

expect(result.cleaned).toHaveLength(2);

415-

expect(result.cleaned.map((entry) => path.basename(entry.lockPath)).toSorted()).toEqual([

416-

"dead.jsonl.lock",

417-

"old-live.jsonl.lock",

425+

expect(lockCleanupRecords(result.locks)).toEqual([

426+

{

427+

name: "dead.jsonl.lock",

428+

removed: true,

429+

stale: true,

430+

staleReasons: ["dead-pid", "too-old"],

431+

},

432+

{

433+

name: "fresh-live.jsonl.lock",

434+

removed: false,

435+

stale: false,

436+

staleReasons: [],

437+

},

438+

{

439+

name: "old-live.jsonl.lock",

440+

removed: true,

441+

stale: true,

442+

staleReasons: ["too-old"],

443+

},

444+

]);

445+

expect(lockCleanupRecords(result.cleaned)).toEqual([

446+

{

447+

name: "dead.jsonl.lock",

448+

removed: true,

449+

stale: true,

450+

staleReasons: ["dead-pid", "too-old"],

451+

},

452+

{

453+

name: "old-live.jsonl.lock",

454+

removed: true,

455+

stale: true,

456+

staleReasons: ["too-old"],

457+

},

418458

]);

419459420460

await expectPathMissing(staleDeadLock);

@@ -451,11 +491,22 @@ describe("acquireSessionWriteLock", () => {

451491

readOwnerProcessArgs: () => ["python", "worker.py"],

452492

});

453493454-

expect(result.locks).toHaveLength(1);

455-

expect(result.cleaned.map((entry) => path.basename(entry.lockPath))).toEqual([

456-

"false-live.jsonl.lock",

494+

expect(lockCleanupRecords(result.locks)).toEqual([

495+

{

496+

name: "false-live.jsonl.lock",

497+

removed: true,

498+

stale: true,

499+

staleReasons: ["non-openclaw-owner"],

500+

},

501+

]);

502+

expect(lockCleanupRecords(result.cleaned)).toEqual([

503+

{

504+

name: "false-live.jsonl.lock",

505+

removed: true,

506+

stale: true,

507+

staleReasons: ["non-openclaw-owner"],

508+

},

457509

]);

458-

expect(result.cleaned[0]?.staleReasons).toContain("non-openclaw-owner");

459510

await expect(fs.access(falseLiveLock)).rejects.toThrow();

460511

} finally {

461512

await fs.rm(root, { recursive: true, force: true });

@@ -488,10 +539,14 @@ describe("acquireSessionWriteLock", () => {

488539

readOwnerProcessArgs: () => ["node", "/srv/app/dist/index.js"],

489540

});

490541491-

expect(result.cleaned.map((entry) => path.basename(entry.lockPath))).toEqual([

492-

"false-live-generic-entry.jsonl.lock",

542+

expect(lockCleanupRecords(result.cleaned)).toEqual([

543+

{

544+

name: "false-live-generic-entry.jsonl.lock",

545+

removed: true,

546+

stale: true,

547+

staleReasons: ["non-openclaw-owner"],

548+

},

493549

]);

494-

expect(result.cleaned[0]?.staleReasons).toContain("non-openclaw-owner");

495550

await expect(fs.access(falseLiveLock)).rejects.toThrow();

496551

} finally {

497552

await fs.rm(root, { recursive: true, force: true });

@@ -599,11 +654,22 @@ describe("acquireSessionWriteLock", () => {

599654

removeStale: true,

600655

});

601656602-

expect(result.locks).toHaveLength(1);

603-

expect(result.cleaned.map((entry) => path.basename(entry.lockPath))).toEqual([

604-

"orphan-self.jsonl.lock",

657+

expect(lockCleanupRecords(result.locks)).toEqual([

658+

{

659+

name: "orphan-self.jsonl.lock",

660+

removed: true,

661+

stale: true,

662+

staleReasons: ["orphan-self-pid"],

663+

},

664+

]);

665+

expect(lockCleanupRecords(result.cleaned)).toEqual([

666+

{

667+

name: "orphan-self.jsonl.lock",

668+

removed: true,

669+

stale: true,

670+

staleReasons: ["orphan-self-pid"],

671+

},

605672

]);

606-

expect(result.cleaned[0]?.staleReasons).toContain("orphan-self-pid");

607673

await expectPathMissing(orphanSelfLock);

608674

} finally {

609675

await fs.rm(root, { recursive: true, force: true });