Limit ts-jest worker usage in Jest configs to prevent memory exhaustion on high-core-count machines.

This commit is contained in:
MartinBraquet
2026-07-29 22:58:54 +02:00
parent 9612028e2c
commit f2c93e3220
6 changed files with 24 additions and 0 deletions

View File

@@ -26,4 +26,8 @@ module.exports = {
collectCoverageFrom: ['src/**/*.{ts,tsx}', '!src/**/*.d.ts'],
silent: true,
// Each ts-jest worker is a full TS-compiling process; the default (cpus - 1) can spawn enough
// of them in parallel to exhaust memory on high-core-count machines.
maxWorkers: '50%',
workerIdleMemoryLimit: '512MB',
}

View File

@@ -23,4 +23,8 @@ module.exports = {
collectCoverageFrom: ['src/**/*.{ts,tsx}', '!src/**/*.d.ts'],
silent: true,
// Each ts-jest worker is a full TS-compiling process; the default (cpus - 1) can spawn enough
// of them in parallel to exhaust memory on high-core-count machines.
maxWorkers: '50%',
workerIdleMemoryLimit: '512MB',
}

View File

@@ -27,4 +27,8 @@ module.exports = {
collectCoverageFrom: ['src/**/*.{ts,tsx}', '!src/**/*.d.ts'],
silent: true,
// Each ts-jest worker is a full TS-compiling process; the default (cpus - 1) can spawn enough
// of them in parallel to exhaust memory on high-core-count machines.
maxWorkers: '50%',
workerIdleMemoryLimit: '512MB',
}

View File

@@ -12,4 +12,8 @@ module.exports = {
testMatch: ['**/*.test.ts'],
collectCoverageFrom: ['src/**/*.{ts,tsx}', '!src/**/*.d.ts'],
silent: true,
// Each ts-jest worker is a full TS-compiling process; the default (cpus - 1) can spawn enough
// of them in parallel to exhaust memory on high-core-count machines.
maxWorkers: '50%',
workerIdleMemoryLimit: '512MB',
}

View File

@@ -21,4 +21,8 @@ module.exports = {
'<rootDir>/web',
],
silent: true,
// Each ts-jest worker is a full TS-compiling process; the default (cpus - 1) can spawn enough
// of them in parallel to exhaust memory on high-core-count machines.
maxWorkers: '50%',
workerIdleMemoryLimit: '512MB',
}

View File

@@ -23,4 +23,8 @@ module.exports = {
collectCoverageFrom: ['src/**/*.{ts,tsx}', '!src/**/*.d.ts'],
silent: true,
// Each ts-jest worker is a full TS-compiling process; the default (cpus - 1) can spawn enough
// of them in parallel to exhaust memory on high-core-count machines.
maxWorkers: '50%',
workerIdleMemoryLimit: '512MB',
}