avajs / ava

Node.js test runner that lets you develop with confidence 🚀
MIT License
20.74k stars 1.41k forks source link

"Timed out while running tests" #3034

Closed sculpt0r closed 2 years ago

sculpt0r commented 2 years ago

I've just started receiving more and more timed out. TBH It is rare to run proper tests... My config:

process.env.TS_NODE_PROJECT = './tsconfig.test.json';

module.exports = {
    failWithoutAssertions: false,
    extensions: [ 'js', 'ts' ],
    files: [ './src/**/tests/**/*.ts', '!./src/**/tests/_utils/**/*.ts' ],
    require: [ 'ts-node/register', 'source-map-support/register' ]
};

I'm not sure what else I could add here - because there is no errors in the console, only

image

Increasing the timeout in config or in the single test does not help at all...

It looks like the async tests cause this trouble: test( '', async t => {} ): Running a single test without async works fine - and the results seem to appear exactly at the moment when the Timed out appears in async test 🤔

AVA: 4.2.0 Node: Tried various: 16.11.0. 16.15.0, 17.9.0, 18.2.0 OS: MacOS 12.2.1

Originally posted by @sculpt0r in https://github.com/avajs/ava/issues/2494#issuecomment-1134480337

sculpt0r commented 2 years ago

I've managed to stabilize tests by adding:

workerThreads: false,
timeout: '80s'

But I would rather say that it looks like a workaround rather than a solution. Does the test cases total amount, test files amount or test cases per file somehow impact the performance? And that might influence the amount of the timeout?

One additional thing: I'm managing the nodeJS versions via nvm.