question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

--fail-fast keeps running other test files

See original GitHub issue

The test process that encounters the error simply exits if --fail-fast is enabled. Since each file runs in its own process, no other tests from that file are reported after the first failure is encountered.

However, other test processes run to completion. I’m not sure whether to:

  • terminate them outright, which prevents any cleanup, even if there are no failures in those processes
  • silence their output, which at least means the test output isn’t cluttered with passing tests, but makes it harder to see why ava won’t exit
  • shrug and say that this is expected

When running with limited concurrency we’ll also run into this scenario, so we should implement the same behavior. Additionally we mustn’t launch new test processes.

Any thoughts on what to do with processes that are already running?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:4
  • Comments:12 (12 by maintainers)

github_iconTop GitHub Comments

1reaction
novemberborncommented, Jan 10, 2017

Ah, so finish the currently running, non-failing tests, including their afterEach callbacks. That way most state would be cleared up, though you may see more than one failure in the test output.

We wouldn’t be able to run the after callbacks though — they may assume the failing tests have completed and therefore crash.

0reactions
novemberborncommented, Feb 10, 2018

As part of #1684 I’ll make sure we stop reporting subsequent test results once a test fails, while still letting the currently active tests run to completion.

OK so what I ended up doing is that workers won’t run other serial tests, or (as long as the error occurs early enough) concurrent tests. Tests that have started are run to completion, including hooks, and shown in the test output. If a test fails in one worker AVA will try and interrupt other workers.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Jest — Fail Early (And Stop Testing If One Test Fails)
Jest comes with a built-in feature to fail early if one test fails. This tutorial shows you how to configure Jest to bail...
Read more >
Possible to "fail fast" when running rake test w/ minitest 5?
If you are using Rails 5, try rails test -f will 'fail fast'. It means abort test run of first failure or error...
Read more >
[go] testing: skip parallel tests when -failfast is enabled
testing: skip parallel tests when -failfast is enabled. The t.Parallel method does not interact well with the -failfast flag. See golang/go#30522.
Read more >
Fail Fast Testing - GitLab Docs
For applications that use RSpec for running tests, we've introduced the Verify/Failfast template to run subsets of your test suite, based on the...
Read more >
cypress-fail-fast - npm
writeFileSync(isCancelledFlagFile); }, isCancelled: () => { // If any other run has created the file, start skipping tests return fs.existsSync( ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found