--fail-fast keeps running other test files
See original GitHub issueThe 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:
- Created 7 years ago
- Reactions:4
- Comments:12 (12 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
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.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.