(config: ResolvedConfig, pool: string)
| 320 | } |
| 321 | |
| 322 | function getMemoryLimit(config: ResolvedConfig, pool: string) { |
| 323 | if (pool !== 'vmForks' && pool !== 'vmThreads') { |
| 324 | return null |
| 325 | } |
| 326 | |
| 327 | const memory = nodeos.totalmem() |
| 328 | const limit = getWorkerMemoryLimit(config) |
| 329 | |
| 330 | if (typeof memory === 'number') { |
| 331 | return stringToBytes(limit, config.watch ? memory / 2 : memory) |
| 332 | } |
| 333 | |
| 334 | // If totalmem is not supported we cannot resolve percentage based values like 0.5, "50%" |
| 335 | if ( |
| 336 | (typeof limit === 'number' && limit > 1) |
| 337 | || (typeof limit === 'string' && limit.at(-1) !== '%') |
| 338 | ) { |
| 339 | return stringToBytes(limit) |
| 340 | } |
| 341 | |
| 342 | // just ignore "memoryLimit" value because we cannot detect memory limit |
| 343 | return null |
| 344 | } |
| 345 | |
| 346 | function groupSpecs(specs: TestSpecification[], environments: WeakMap<TestSpecification, ContextTestEnvironment>) { |
| 347 | // Test files are passed to test runner one at a time, except for Typechecker or when "--maxWorker=1 --no-isolate" |
no test coverage detected