test: isolate base vitest thread blockers

This commit is contained in:
Peter Steinberger
2026-03-23 01:24:52 -07:00
parent 8b02ef1332
commit f64f3fdb53
8 changed files with 886 additions and 329 deletions

View File

@@ -103,6 +103,8 @@ type RunWithModelFallbackParams = {
};
beforeEach(() => {
vi.useRealTimers();
vi.clearAllTimers();
runEmbeddedPiAgentMock.mockClear();
runCliAgentMock.mockClear();
runWithModelFallbackMock.mockClear();
@@ -151,6 +153,7 @@ beforeEach(() => {
});
afterEach(() => {
vi.clearAllTimers();
vi.useRealTimers();
resetSystemEventsForTest();
});

View File

@@ -142,6 +142,8 @@ afterAll(async () => {
});
beforeEach(() => {
vi.useRealTimers();
vi.clearAllTimers();
setDefaultChannelPluginRegistryForTests();
readConfigFileSnapshotMock.mockImplementation(async () => {
const configPath = process.env.OPENCLAW_CONFIG_PATH;