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

推荐订阅源

H
Help Net Security
G
Google Developers Blog
aimingoo的专栏
aimingoo的专栏
博客园 - 聂微东
酷 壳 – CoolShell
酷 壳 – CoolShell
小众软件
小众软件
Stack Overflow Blog
Stack Overflow Blog
美团技术团队
博客园_首页
T
Tailwind CSS Blog
博客园 - 三生石上(FineUI控件)
B
Blog
D
DataBreaches.Net
腾讯CDC
C
Check Point Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
U
Unit 42
月光博客
月光博客
V
V2EX
Vercel News
Vercel News
T
The Blog of Author Tim Ferriss
The Cloudflare Blog
博客园 - 叶小钗
Y
Y Combinator 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(unit-fast): isolate fake-timer files (#88160) · open...
RomneyDa · 2026-05-30 · via Recent Commits to openclaw:main

@@ -2,15 +2,19 @@ import { beforeAll, describe, expect, it } from "vitest";

22

import { spawnNodeEvalSync } from "../src/test-utils/node-process.js";

33

import { createCommandsLightVitestConfig } from "./vitest/vitest.commands-light.config.ts";

44

import { createPluginSdkLightVitestConfig } from "./vitest/vitest.plugin-sdk-light.config.ts";

5+

import { createUnitFastFakeTimersVitestConfig } from "./vitest/vitest.unit-fast-fake-timers.config.ts";

56

import {

67

classifyUnitFastTestFileContent,

78

collectBroadUnitFastTestCandidates,

89

collectUnitFastTestCandidates,

910

collectUnitFastTestFileAnalysis,

1011

forcedUnitFastTestFiles,

1112

getUnitFastTestFiles,

13+

getUnitFastTimerTestFiles,

1214

isUnitFastTestFile,

15+

isUnitFastTimerTestFile,

1316

resolveUnitFastTestIncludePattern,

17+

resolveUnitFastTimerTestIncludePattern,

1418

} from "./vitest/vitest.unit-fast-paths.mjs";

1519

import { createUnitFastVitestConfig } from "./vitest/vitest.unit-fast.config.ts";

1620

@@ -53,6 +57,7 @@ describe("unit-fast vitest lane", () => {

5357

let configProbeResult: ReturnType<typeof spawnNodeEvalSync>;

5458

let unitFastConfig: ReturnType<typeof createUnitFastVitestConfig>;

5559

let unitFastTestFiles: ReturnType<typeof getUnitFastTestFiles>;

60+

let unitFastTimerTestFiles: ReturnType<typeof getUnitFastTimerTestFiles>;

5661

let unitFastAnalysis: ReturnType<typeof collectUnitFastTestFileAnalysis>;

5762

let broadCandidates: ReturnType<typeof collectBroadUnitFastTestCandidates>;

5863

let broadAnalysis: ReturnType<typeof collectUnitFastTestFileAnalysis>;

@@ -77,6 +82,7 @@ describe("unit-fast vitest lane", () => {

7782

});

7883

unitFastConfig = createUnitFastVitestConfig({});

7984

unitFastTestFiles = getUnitFastTestFiles();

85+

unitFastTimerTestFiles = getUnitFastTimerTestFiles();

8086

unitFastAnalysis = collectUnitFastTestFileAnalysis();

8187

currentCandidates = collectUnitFastTestCandidates();

8288

broadCandidates = collectBroadUnitFastTestCandidates();

@@ -106,7 +112,6 @@ describe("unit-fast vitest lane", () => {

106112

expect(testConfig.include).toContain("src/acp/control-plane/runtime-cache.test.ts");

107113

expect(testConfig.include).toContain("src/acp/runtime/registry.test.ts");

108114

expect(testConfig.include).toContain("src/commands/status-overview-values.test.ts");

109-

expect(testConfig.include).toContain("src/entry.respawn.test.ts");

110115

expect(testConfig.include).toContain("src/entry.version-fast-path.test.ts");

111116

expect(testConfig.include).toContain("src/flows/doctor-startup-channel-maintenance.test.ts");

112117

expect(testConfig.include).toContain("src/crestodian/rescue-policy.test.ts");

@@ -127,7 +132,6 @@ describe("unit-fast vitest lane", () => {

127132

expect(testConfig.include).toContain("src/security/audit-gateway-tools-http.test.ts");

128133

expect(testConfig.include).toContain("src/security/audit-plugin-readonly-scope.test.ts");

129134

expect(testConfig.include).toContain("src/security/audit-loopback-logging.test.ts");

130-

expect(testConfig.include).toContain("src/security/audit-sandbox-browser.test.ts");

131135

expect(testConfig.include).toContain("src/ui-app-settings.agents-files-refresh.test.ts");

132136

expect(testConfig.include).toContain("src/video-generation/provider-registry.test.ts");

133137

expect(testConfig.include).toContain("src/plugin-sdk/provider-entry.test.ts");

@@ -187,6 +191,26 @@ describe("unit-fast vitest lane", () => {

187191

expect(unroutedForcedFiles).toStrictEqual([]);

188192

});

189193194+

it("routes fake-timer unit-fast tests through the serial fake-timer lane", () => {

195+

const fakeTimerFiles = unitFastAnalysis

196+

.filter((entry) => entry.unitFast && entry.reasons.includes("fake-timers"))

197+

.map((entry) => entry.file);

198+

expect(unitFastTimerTestFiles.length).toBeGreaterThan(0);

199+

expect(unitFastTimerTestFiles).toEqual(fakeTimerFiles);

200+

for (const file of unitFastTimerTestFiles) {

201+

expect(isUnitFastTimerTestFile(file)).toBe(true);

202+

expect(resolveUnitFastTestIncludePattern(file)).toBeNull();

203+

expect(resolveUnitFastTimerTestIncludePattern(file)).toBe(file);

204+

}

205+206+

const fastConfig = requireTestConfig(unitFastConfig);

207+

const timerConfig = requireTestConfig(createUnitFastFakeTimersVitestConfig({}));

208+

expect(fastConfig.include).not.toEqual(expect.arrayContaining(unitFastTimerTestFiles));

209+

expect(timerConfig.include).toEqual(unitFastTimerTestFiles);

210+

expect(timerConfig.fileParallelism).toBe(false);

211+

expect(timerConfig.maxWorkers).toBe(1);

212+

});

213+190214

it("keeps broad audit candidates separate from automatically routed unit-fast tests", () => {

191215

expect(currentCandidates.length).toBeGreaterThanOrEqual(unitFastTestFiles.length);

192216

expect(broadCandidates.length).toBeGreaterThan(currentCandidates.length);