clearMocks throws error on large test suite
See original GitHub issueAfter creating over 30 tests with 3 transactions each, I started getting a Parent database is not open error. I have clearMocks flag enabled. When I disable it, error doesn’t appear but my tests are no longer valid.
I have an 8 core linux machine and I tried to reduce concurrency to 1 and still got the same error.
See this log:
events.js:287
throw er; // Unhandled 'error' event
^
Error [OpenError]: Parent database is not open
at .../project/node_modules/levelup/lib/levelup.js:119:23
at .../project/node_modules/abstract-leveldown/abstract-leveldown.js:38:14
at .../project/node_modules/deferred-leveldown/deferred-leveldown.js:31:21
at .../project/node_modules/encoding-down/node_modules/abstract-leveldown/abstract-leveldown.js:38:14
at .../project/node_modules/subleveldown/node_modules/abstract-leveldown/abstract-leveldown.js:38:14
at onopen (.../project/node_modules/subleveldown/leveldown.js:141:35)
at processTicksAndRejections (internal/process/task_queues.js:79:11)
at runNextTicks (internal/process/task_queues.js:66:3)
at processImmediate (internal/timers.js:429:9)
at process.topLevelDomainCallback (domain.js:137:15)
Emitted 'error' event on LevelUP instance at:
at .../project/node_modules/levelup/lib/levelup.js:60:19
at .../project/node_modules/levelup/lib/levelup.js:119:14
at .../project/node_modules/abstract-leveldown/abstract-leveldown.js:38:14
[... lines matching original stack trace ...]
at processImmediate (internal/timers.js:429:9)
I tried to reproduce with minimal code but it is hard.
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
How to resolve jest error when attempting to run test suite?
Issue resolved. Issue was caused by running the tests by using the "jest" command in the terminal which is different from using the...
Read more >Clean Unit Tests with Mockito - Reflectoring
The test case consists of the system under test CityService and its dependencies. ... @Test void find() throws Exception { City expected ...
Read more >Configuring Jest
By default, Jest runs all tests and produces all errors into the ... Jest will run .mjs and .js files with nearest package.json...
Read more >API Reference | Vitest
Use test.only to only run certain tests in a given suite. ... If it's not, assertion will throw an error, and the test...
Read more >MockK | mocking library for Kotlin
A class cast exception is usually thrown in this case. Opt for stubbing manually in the case of a generic return type. Workaround:...
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
Last time it worked with my 80 tests test suite. Now that I started using
test.each
(and some other changes) it stops working at 39 tests (it is working fine with 38 tests).I will try to simplify more my test code.
Yep, the package definitely needs better error messages.