-
Notifications
You must be signed in to change notification settings - Fork 5.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AbortSignal.timeout() causes Deno.test() to report leaking resources? #20663
Comments
bartlomieju
added
bug
Something isn't working correctly
testing
related to deno test and coverage
labels
Sep 24, 2023
Although tentative, I was able to work around the problem by applying the following stubs. export function abortSignalStub(): Stub<
typeof AbortSignal,
Parameters<typeof AbortSignal.timeout>,
AbortSignal
> {
return stub(
AbortSignal,
"timeout",
() => new AbortController().signal,
)
} |
tdb-alcorn
added a commit
to tdb-alcorn/deno
that referenced
this issue
May 16, 2024
iuioiua
added a commit
that referenced
this issue
Jun 18, 2024
<!-- Before submitting a PR, please read https://docs.deno.com/runtime/manual/references/contributing 1. Give the PR a descriptive title. Examples of good title: - fix(std/http): Fix race condition in server - docs(console): Update docstrings - feat(doc): Handle nested reexports Examples of bad title: - fix #7123 - update docs - fix bugs 2. Ensure there is a related issue and it is referenced in the PR text. 3. Ensure there are tests that cover the changes. 4. Ensure `cargo test` passes. 5. Ensure `./tools/format.js` passes without changing files. 6. Ensure `./tools/lint.js` passes. 7. Open as a draft PR if your work is still in progress. The CI won't run all steps, but you can add '[ci]' to a commit message to force it to. 8. If you would like to run the benchmarks on the CI, add the 'ci-bench' label. --> Fixes #20663. --------- Co-authored-by: Asher Gomez <[email protected]> Co-authored-by: Divy Srivastava <[email protected]>
bartlomieju
pushed a commit
that referenced
this issue
Jun 18, 2024
<!-- Before submitting a PR, please read https://docs.deno.com/runtime/manual/references/contributing 1. Give the PR a descriptive title. Examples of good title: - fix(std/http): Fix race condition in server - docs(console): Update docstrings - feat(doc): Handle nested reexports Examples of bad title: - fix #7123 - update docs - fix bugs 2. Ensure there is a related issue and it is referenced in the PR text. 3. Ensure there are tests that cover the changes. 4. Ensure `cargo test` passes. 5. Ensure `./tools/format.js` passes without changing files. 6. Ensure `./tools/lint.js` passes. 7. Open as a draft PR if your work is still in progress. The CI won't run all steps, but you can add '[ci]' to a commit message to force it to. 8. If you would like to run the benchmarks on the CI, add the 'ci-bench' label. --> Fixes #20663. --------- Co-authored-by: Asher Gomez <[email protected]> Co-authored-by: Divy Srivastava <[email protected]>
zebreus
pushed a commit
to zebreus/deno
that referenced
this issue
Jul 8, 2024
<!-- Before submitting a PR, please read https://docs.deno.com/runtime/manual/references/contributing 1. Give the PR a descriptive title. Examples of good title: - fix(std/http): Fix race condition in server - docs(console): Update docstrings - feat(doc): Handle nested reexports Examples of bad title: - fix denoland#7123 - update docs - fix bugs 2. Ensure there is a related issue and it is referenced in the PR text. 3. Ensure there are tests that cover the changes. 4. Ensure `cargo test` passes. 5. Ensure `./tools/format.js` passes without changing files. 6. Ensure `./tools/lint.js` passes. 7. Open as a draft PR if your work is still in progress. The CI won't run all steps, but you can add '[ci]' to a commit message to force it to. 8. If you would like to run the benchmarks on the CI, add the 'ci-bench' label. --> Fixes denoland#20663. --------- Co-authored-by: Asher Gomez <[email protected]> Co-authored-by: Divy Srivastava <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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: