Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AVA Test fails due to timeout, however, exit code 0 is returned #3098

Closed
simplenotezy opened this issue Aug 30, 2022 · 2 comments · Fixed by #3099
Closed

AVA Test fails due to timeout, however, exit code 0 is returned #3098

simplenotezy opened this issue Aug 30, 2022 · 2 comments · Fixed by #3099
Assignees
Labels
bug current functionality does not work as desired scope:internals

Comments

@simplenotezy
Copy link

We sometimes experience that the Github actions to deploy our application fails the test suite, however, it marks it as completed. See:

image

Should be (same test, just a few minutes earlier):

image

We run the command:

ava --no-worker-threads -c 1 --verbose --timeout 1m --fail-fast

Using ava version: ^4.3.1

@liby
Copy link

liby commented Sep 2, 2022

There is a similar error, not sure if the issue is the same.

Configuration:

  "ava": {
    "require": [
      "@swc-node/register"
    ],
    "extensions": [
      "ts"
    ],
    "environmentVariables": {
      "TS_NODE_PROJECT": "./tsconfig.json"
    },
    "workerThreads": false
  },

Setting timeout to 80s can solve this issue temporarily, but it will lead to too long job time.
image

@novemberborn
Copy link
Member

Looks like the exit code is only 1 when there still were pending tests, which won't always be the case.

ava/lib/run-status.js

Lines 129 to 130 in ea597d8

for (const testsInFile of event.pendingTests.values()) {
stats.timeouts += testsInFile.size;

@novemberborn novemberborn added bug current functionality does not work as desired scope:internals and removed needs triage labels Sep 4, 2022
@novemberborn novemberborn self-assigned this Sep 4, 2022
novemberborn added a commit that referenced this issue Sep 4, 2022
This ensures AVA exits with code 1 if any timeout occurs, even if there were no pending tests.

Fixes #3098.
novemberborn added a commit that referenced this issue Sep 4, 2022
This ensures AVA exits with code 1 if any timeout occurs, even if there were no pending tests.

Fixes #3098.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug current functionality does not work as desired scope:internals
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants