You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using AbortSignal.timeout() in fetch requests init object, when testing my concurrent request plugin i discovered that my tests fail, not because they don't work, but because deno is saying:
error: AssertionError: Test case is leaking async ops.
- 1 async operation to sleep for a duration was started in this test, but never completed. This is often caused by not cancelling a `setTimeout` or `setInterval` call.
I mean it's not saying it explicitely, but my strong suspicion is that the automatic timeout() on the AbortSignal is what causes this...the problem is, how would i fix that? AFAIK there is no way to stop that timeout like we can with clearTimeout on regular setTimeouts, or didn't I dig deep enough into MDN?
EDIT: This is what is reported additionally when --trace-ops is added:
The operation was started here:
at handleOpCallTracing (internal:core/01_core.js:237:42)
at Object.op_sleep (eval at genAsyncOp (internal:core/01_core.js:181:14), <anonymous>:15:21)
at Object.opAsync (internal:core/01_core.js:249:12)
at runAfterTimeout (internal:ext/web/02_timers.js:219:31)
at initializeTimer (internal:ext/web/02_timers.js:185:5)
at setTimeout (internal:ext/web/02_timers.js:319:12)
at Function.timeout (internal:ext/web/03_abort_signal.js:50:25)
so it looks like the suspicion was correct... well, now what can we do to fix this?
as far as a workaround disabling sanitizeResources in the tests probably will do, but i like that sanitizer and would prefer keeping it active (for other leaky stuff), so if there is a fix or other workaround (other than waiting for the entire timeout at the end of the test of course, lol) it would be good to know.
EDIT 2: Turns out i need to set both of those to false to make the actual tests pass without being the sanitizers the reason they fail:
sanitizeResources: false,
sanitizeOps: false,
The text was updated successfully, but these errors were encountered:
Although tentative, I was able to work around the problem by applying the following stubs.
However, since we cannot reproduce the timeout behavior, some tests may have problems.
I'm using
AbortSignal.timeout()
in fetch requests init object, when testing my concurrent request plugin i discovered that my tests fail, not because they don't work, but because deno is saying:I mean it's not saying it explicitely, but my strong suspicion is that the automatic timeout() on the AbortSignal is what causes this...the problem is, how would i fix that? AFAIK there is no way to stop that timeout like we can with clearTimeout on regular setTimeouts, or didn't I dig deep enough into MDN?
EDIT: This is what is reported additionally when --trace-ops is added:
so it looks like the suspicion was correct... well, now what can we do to fix this?
as far as a workaround disabling
sanitizeResources
in the tests probably will do, but i like that sanitizer and would prefer keeping it active (for other leaky stuff), so if there is a fix or other workaround (other than waiting for the entire timeout at the end of the test of course, lol) it would be good to know.EDIT 2: Turns out i need to set both of those to false to make the actual tests pass without being the sanitizers the reason they fail:
The text was updated successfully, but these errors were encountered: