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

推荐订阅源

L
LangChain Blog
博客园 - 司徒正美
美团技术团队
Martin Fowler
Martin Fowler
雷峰网
雷峰网
aimingoo的专栏
aimingoo的专栏
博客园 - 三生石上(FineUI控件)
Vercel News
Vercel News
酷 壳 – CoolShell
酷 壳 – CoolShell
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
爱范儿
爱范儿
U
Unit 42
Y
Y Combinator Blog
月光博客
月光博客
Hugging Face - Blog
Hugging Face - Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
有赞技术团队
有赞技术团队
GbyAI
GbyAI
H
Help Net Security
量子位
Last Week in AI
Last Week in AI
博客园_首页
腾讯CDC
小众软件
小众软件

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: dedupe health snapshot mock calls · openclaw/opencl...
steipete · 2026-05-12 · via Recent Commits to openclaw:main

@@ -7,6 +7,17 @@ vi.mock("../../commands/health.js", () => ({

77

getHealthSnapshot: getHealthSnapshotMock,

88

}));

9910+

function healthSnapshotCallArg(index = 0) {

11+

return getHealthSnapshotMock.mock.calls.at(index)?.at(0) as

12+

| {

13+

eventLoop?: unknown;

14+

includeSensitive?: boolean;

15+

probe?: boolean;

16+

runtimeSnapshot?: unknown;

17+

}

18+

| undefined;

19+

}

20+1021

function createHealthSummary(): HealthSummary {

1122

return {

1223

ok: true,

@@ -57,7 +68,7 @@ describe("refreshGatewayHealthSnapshot", () => {

5768

includeSensitive: false,

5869

runtimeSnapshot: undefined,

5970

});

60-

expect(Object.hasOwn(getHealthSnapshotMock.mock.calls[0]?.[0] ?? {}, "eventLoop")).toBe(false);

71+

expect(Object.hasOwn(healthSnapshotCallArg() ?? {}, "eventLoop")).toBe(false);

6172

resolveSnapshot?.(createHealthSummary());

6273

await expect(Promise.all([first, second])).resolves.toHaveLength(2);

6374

});

@@ -84,8 +95,8 @@ describe("refreshGatewayHealthSnapshot", () => {

8495

});

85968697

expect(getHealthSnapshotMock).toHaveBeenCalledTimes(2);

87-

expect(getHealthSnapshotMock.mock.calls[0]?.[0]?.eventLoop).toBe(eventLoop);

88-

expect(Object.hasOwn(getHealthSnapshotMock.mock.calls[1]?.[0] ?? {}, "eventLoop")).toBe(false);

98+

expect(healthSnapshotCallArg()?.eventLoop).toBe(eventLoop);

99+

expect(Object.hasOwn(healthSnapshotCallArg(1) ?? {}, "eventLoop")).toBe(false);

89100

});

9010191102

it("captures runtime snapshots for completed refreshes and guards snapshot failures", async () => {

@@ -109,15 +120,16 @@ describe("refreshGatewayHealthSnapshot", () => {

109120

expect(getHealthSnapshotMock).toHaveBeenCalledTimes(2);

110121

expect(

111122

getHealthSnapshotMock.mock.calls

112-

.map((call) => call[0]?.probe)

123+

.map((_call, index) => healthSnapshotCallArg(index)?.probe)

113124

.toSorted((a, b) => Number(a) - Number(b)),

114125

).toEqual([false, true]);

115-

expect(getHealthSnapshotMock.mock.calls.map((call) => call[0]?.includeSensitive)).toEqual([

116-

false,

117-

false,

118-

]);

119-

expect(getHealthSnapshotMock.mock.calls[0]?.[0]?.runtimeSnapshot).toBe(runtimeSnapshot);

120-

expect(getHealthSnapshotMock.mock.calls[1]?.[0]?.runtimeSnapshot).toBeUndefined();

126+

expect(

127+

getHealthSnapshotMock.mock.calls.map(

128+

(_call, index) => healthSnapshotCallArg(index)?.includeSensitive,

129+

),

130+

).toEqual([false, false]);

131+

expect(healthSnapshotCallArg()?.runtimeSnapshot).toBe(runtimeSnapshot);

132+

expect(healthSnapshotCallArg(1)?.runtimeSnapshot).toBeUndefined();

121133

});

122134123135

it("does not cache or broadcast sensitive health refreshes", async () => {

@@ -171,8 +183,8 @@ describe("refreshGatewayHealthSnapshot", () => {

171183

const safe = healthState.refreshGatewayHealthSnapshot({ probe: false });

172184173185

expect(getHealthSnapshotMock).toHaveBeenCalledTimes(2);

174-

expect(getHealthSnapshotMock.mock.calls[0]?.[0]?.includeSensitive).toBe(true);

175-

expect(getHealthSnapshotMock.mock.calls[1]?.[0]?.includeSensitive).toBe(false);

186+

expect(healthSnapshotCallArg()?.includeSensitive).toBe(true);

187+

expect(healthSnapshotCallArg(1)?.includeSensitive).toBe(false);

176188177189

resolveSensitive?.();

178190

resolveSafe?.();