Spixy
Spixy15mo ago

Test case is leaking resources

Hi, all my tests keeps failing because of
error: AssertionError: Test case is leaking 2 resources:
- A timer (rid 770) was started before the test started, but was fired/cleared during the test. Do not close resources in a test that were not created during that test.
- A timer (rid 773) was started during the test, but not fired/cleared during the test. Clear the timer by calling `clearInterval` or `clearTimeout`.

at assert (deno:ext/web/00_infra.js:295:13) ...
error: AssertionError: Test case is leaking 2 resources:
- A timer (rid 770) was started before the test started, but was fired/cleared during the test. Do not close resources in a test that were not created during that test.
- A timer (rid 773) was started during the test, but not fired/cleared during the test. Clear the timer by calling `clearInterval` or `clearTimeout`.

at assert (deno:ext/web/00_infra.js:295:13) ...
3 Replies
Spixy
Spixy15mo ago
Google didnt help, there is only one setTimeout in the code and I commented it out. I use Deno.test
Sorikairo
Sorikairo15mo ago
You gotta share the test code my dear, otherwise it's kinda complicated
Spixy
Spixy15mo ago
ok I found it occurs when using DB with Typeorm (npm:typeorm@0.2.45)