skipAllAfterTimeLimit throws an error instead of skipping tests
See original GitHub issue🐛 Bug Report
skipAllAfterTimeLimit throws an error instead of skipping the remaining tests like the name suggests
To Reproduce
Steps to reproduce:
it(‘should skip tests’, async () => {
jest.useRealTimers();
const property = fc.asyncProperty(
fc.constant(''),
async () => {
await new Promise(resolve => setTimeout(resolve, 100));
expect(true).toBe(true);
}
);
await fc.assert(property, {
numRuns: 10,
skipAllAfterTimeLimit: 1,
});
});
});
Expected behavior
It should skip all remaining tests instead of throwing error. We could have a parameter, similar to maxSkipsPerRun, to specify the max amount of tests it can skip.
Your environment
Packages / Softwares | Version(s) |
---|---|
fast-check | 1.16.2 |
node | 10.14.1 |
TypeScript | 3.4.5 |
Issue Analytics
- State:
- Created 4 years ago
- Reactions:2
- Comments:11 (8 by maintainers)
Top Results From Across the Web
Methods for Skipping Tests | Apple Developer Documentation
Skip tests when meeting specified conditions. ... Throw an XCTSkip error when you have other circumstances that result in skipped tests. For example:....
Read more >Cannot determine how Jest is skipping tests #4763 - GitHub
When I run Jest in watch mode and hit "a" (to run all tests), Jest still skips ... skipped 1 test instead of...
Read more >swift - iOS Testing: Is there a way to skip tests? - Stack Overflow
To skip a test, call one of the new XCTSkip* functions from within a test method or setUp(). For example: func test_canAuthenticate() throws...
Read more >Maven Surefire Plugin – Skipping Tests
To skip running the tests for a particular project, ... You can also skip the tests via the command line by executing the...
Read more >Parameters | fast-check | Property based testing framework
Documentation for API Reference | fast-check | Property based testing framework. ... Should the thrown Error include a cause leading to the original...
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 FreeTop 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
Top GitHub Comments
I see that the fail message with very verbose mode only shows the generated value. Could we add the seed and path to each one ?
Current error message:
skipAllAfterTimeLimit
I agree that
skipAllAfterTimeLimit
was not well defined. The initial idea behind this feature was: mark runs as skipped as soon as the time limit expired.In fast-check, a run can have 3 different states: success, failure, skipped (mainly triggered by
fc.pre
). InitiallyskipAllAfterTimeLimit
was supposed to mark all runs as skipped after the time limit.There are two possible outcomes:
See https://github.com/dubzzz/fast-check/pull/425 which just fix the feature as it was initially defined.
interruptAfterTimeLimit
On the contrary,
interruptAfterTimeLimit
does not mark runs as skipped. It just stops the execution of the test suite. There two possibilities: either it should be marked as a failure, or a success with not enough runs (seemarkInterruptAsFailure
in https://github.com/dubzzz/fast-check/pull/428).Internally
interruptAfterTimeLimit
really interrupts the execution either by marking it as failure or as success. WhileskipAllAfterTimeLimit
just marks everything as skipped.conclusion
skipAllAfterTimeLimit
: mark runs as skipped after timeout (shrunk values will still be produced)interruptAfterTimeLimit
: stop execution after timeout - test is considered as success if it has never encountered an issue - I have to double check in my implementation that if it happens while shrinking the reported error is the smallest failure not the shrunk where it stoppedinterruptAfterTimeLimit
andmarkInterruptAsFailure:true
: stop execution after timeout - an interrupted test is considered as a failed test - maybe the contrarymarkInterruptAsSuccess
Actually I’m still looking for the right way to add this interrupt/skip/whatever feature (maybe replacing
skipAllAfterTimeLimit
).