mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-23 19:44:30 -07:00
ci: shard windows tests and fix event listener leaks (#18670)
This commit is contained in:
@@ -10,11 +10,19 @@ if (process.env.NO_COLOR !== undefined) {
|
||||
}
|
||||
|
||||
import { setSimulate429 } from './src/utils/testUtils.js';
|
||||
import { vi } from 'vitest';
|
||||
import { vi, afterEach } from 'vitest';
|
||||
import { coreEvents } from './src/utils/events.js';
|
||||
|
||||
// Increase max listeners to avoid warnings in large test suites
|
||||
coreEvents.setMaxListeners(100);
|
||||
|
||||
// Disable 429 simulation globally for all tests
|
||||
setSimulate429(false);
|
||||
|
||||
afterEach(() => {
|
||||
vi.unstubAllEnvs();
|
||||
});
|
||||
|
||||
// Default mocks for Storage and ProjectRegistry to prevent disk access in most tests.
|
||||
// These can be overridden in specific tests using vi.unmock().
|
||||
|
||||
|
||||
@@ -9,8 +9,9 @@ import { defineConfig } from 'vitest/config';
|
||||
export default defineConfig({
|
||||
test: {
|
||||
reporters: ['default', 'junit'],
|
||||
timeout: 30000,
|
||||
hookTimeout: 30000,
|
||||
testTimeout: 60000,
|
||||
hookTimeout: 60000,
|
||||
pool: 'forks',
|
||||
silent: true,
|
||||
setupFiles: ['./test-setup.ts'],
|
||||
outputFile: {
|
||||
@@ -32,8 +33,8 @@ export default defineConfig({
|
||||
},
|
||||
poolOptions: {
|
||||
threads: {
|
||||
minThreads: 8,
|
||||
maxThreads: 16,
|
||||
minThreads: 1,
|
||||
maxThreads: 4,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user