Skip to content

Ava skips next tests in file if a previous test timeouts #3165

Closed

Description

@emilis-ideait

Minimal reproducible example

In our test suite we have multiple test(...) tests per file. We are using Selenium to drive a browser in these tests.

Sometimes a test runs longer than the specified timeout.

I noticed that in such case all the remaining tests in the file will be skipped and a "X tests were pending in example-file.js" message will be printed to output.

I expected only the slow test to timeout and the remaining tests to run.

ava.config.js:

export default {
    concurrency:            1,
    files: [
        'test-a.test.js',
        'test-b.test.js',
    ],
    serial:                 true,
    timeout:                '2s',
    verbose:                true,
};

Same happens with both Ava 4.2.0 and 5.1.1.

Activity

  1. novemberborn commented on Feb 6, 2023

    @novemberborn
    Member

    AVA's timeout detection works by tracking how long it's been since there was last an "event" coming out of a test worker. If that takes too long, the worker is stopped.

    Your setup executes tests serially, so subsequent tests are not run.

    I think if you'd use t.timeout() within the test, then that specific test would time out but the rest would continue running.

  2. locked and limited conversation to collaborators on Feb 6, 2023
  3. converted this issue into a discussion #3168 on Feb 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions