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

推荐订阅源

S
SegmentFault 最新的问题
爱范儿
爱范儿
博客园 - 三生石上(FineUI控件)
Microsoft Security Blog
Microsoft Security Blog
Google DeepMind News
Google DeepMind News
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
GbyAI
GbyAI
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
V
V2EX
酷 壳 – CoolShell
酷 壳 – CoolShell
量子位
博客园_首页
T
Tailwind CSS Blog
aimingoo的专栏
aimingoo的专栏
A
About on SuperTechFans
T
The Blog of Author Tim Ferriss
Stack Overflow Blog
Stack Overflow Blog
Recent Announcements
Recent Announcements
P
Proofpoint News Feed
博客园 - 司徒正美
有赞技术团队
有赞技术团队
Engineering at Meta
Engineering at Meta
Last Week in AI
Last Week in AI
MongoDB | Blog
MongoDB | 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: support higher vitest shard parallelism · openclaw/...
steipete · 2026-05-06 · via Recent Commits to openclaw:main
Original file line numberDiff line numberDiff line change

@@ -34,6 +34,26 @@ export function forwardSignalToVitestProcessGroup(params) {

3434

}

3535

}

3636
37+

function ensureProcessListenerCapacity(processObject, eventName, additionalListeners = 1) {

38+

if (

39+

typeof processObject.getMaxListeners !== "function" ||

40+

typeof processObject.setMaxListeners !== "function" ||

41+

typeof processObject.listenerCount !== "function"

42+

) {

43+

return;

44+

}

45+
46+

const currentLimit = processObject.getMaxListeners();

47+

if (currentLimit === 0) {

48+

return;

49+

}

50+
51+

const neededLimit = processObject.listenerCount(eventName) + additionalListeners + 1;

52+

if (neededLimit > currentLimit) {

53+

processObject.setMaxListeners(neededLimit);

54+

}

55+

}

56+
3757

export function installVitestProcessGroupCleanup(params) {

3858

const processObject = params.processObject ?? process;

3959

const platform = params.platform ?? process.platform;

@@ -62,12 +82,14 @@ export function installVitestProcessGroupCleanup(params) {

6282

forward(signal);

6383

};

6484

signalHandlers.set(signal, handler);

85+

ensureProcessListenerCapacity(processObject, signal);

6586

processObject.on(signal, handler);

6687

}

6788
6889

const exitHandler = () => {

6990

forward(cleanupSignal);

7091

};

92+

ensureProcessListenerCapacity(processObject, "exit");

7193

processObject.on("exit", exitHandler);

7294
7395

return () => {

Original file line numberDiff line numberDiff line change

@@ -96,4 +96,46 @@ describe("vitest process group helpers", () => {

9696

expect(listeners.get("SIGTERM")?.size ?? 0).toBe(0);

9797

expect(listeners.get("exit")?.size ?? 0).toBe(0);

9898

});

99+
100+

it("raises process listener limits for highly parallel cleanup handlers", () => {

101+

const listeners = new Map<string, Set<() => void>>();

102+

let maxListeners = 10;

103+

const fakeProcess = {

104+

getMaxListeners: () => maxListeners,

105+

setMaxListeners: vi.fn((value: number) => {

106+

maxListeners = value;

107+

return fakeProcess;

108+

}),

109+

listenerCount(event: string) {

110+

return listeners.get(event)?.size ?? 0;

111+

},

112+

on(event: string, handler: () => void) {

113+

const set = listeners.get(event) ?? new Set();

114+

set.add(handler);

115+

listeners.set(event, set);

116+

},

117+

off(event: string, handler: () => void) {

118+

listeners.get(event)?.delete(handler);

119+

},

120+

};

121+
122+

const teardowns = Array.from({ length: 12 }, (_, index) =>

123+

installVitestProcessGroupCleanup({

124+

child: { pid: 4200 + index },

125+

processObject: fakeProcess as unknown as NodeJS.Process,

126+

platform: "darwin",

127+

kill: vi.fn(),

128+

}),

129+

);

130+
131+

expect(maxListeners).toBeGreaterThan(10);

132+

expect(fakeProcess.setMaxListeners).toHaveBeenCalled();

133+
134+

for (const teardown of teardowns) {

135+

teardown();

136+

}

137+

expect(listeners.get("SIGINT")?.size ?? 0).toBe(0);

138+

expect(listeners.get("SIGTERM")?.size ?? 0).toBe(0);

139+

expect(listeners.get("exit")?.size ?? 0).toBe(0);

140+

});

99141

});