Skip to content
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

fix: release ReadeableStream in fetch #17365

Merged
merged 8 commits into from
Aug 16, 2023
Merged

Conversation

crowlKats
Copy link
Member

Fixes #16648

Copy link
Member

@bartlomieju bartlomieju left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM


Deno.test(
{ permissions: { net: true } },
async function fetchRequestBodyEmptyStream() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fetchRequestBodyEmptyStream => ./cli/tests/unit/fetch_test.ts:1891:6
error: AssertionError: Expected function to reject.
    throw new AssertionError(
          ^
    at assertRejects (file:https:///home/runner/work/deno/deno/test_util/std/testing/asserts.ts:891:11)
    at async fetchRequestBodyEmptyStream (file:https:///home/runner/work/deno/deno/cli/tests/unit/fetch_test.ts:1901:5)

Seems flaky https://github.com/denoland/deno/actions/runs/3904649696/jobs/6670704695

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i tried this test so many times locally and never was... why ci...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I managed to reproduce it by running all the fetch tests together over and over again in two separate terminals. It didn't seem to occur with just one. do { cargo run --bin deno -- test --allow-all --unstable --location=http:https://js-unit-tests/foo/bar .\cli\tests\unit\fetch_test.ts } until ($LastExitCode -ne 0)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hm, unsure what to do here

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I pushed a change to use a synchronous AbortSignal triggering to avoid the flakiness. I think this should be good since now it's not possible for the fetch to get resolved before the abort happens.

@crowlKats crowlKats marked this pull request as draft January 15, 2023 17:55
@aapoalas aapoalas marked this pull request as ready for review May 18, 2023 10:34
@aapoalas
Copy link
Collaborator

Marking as ready to review to get CI.

@crowlKats crowlKats merged commit 1b0e394 into denoland:main Aug 16, 2023
11 checks passed
@crowlKats crowlKats deleted the fetch_short branch August 16, 2023 12:03
littledivy pushed a commit to littledivy/deno that referenced this pull request Aug 21, 2023
littledivy pushed a commit that referenced this pull request Aug 21, 2023
Fixes #16648

---------

Co-authored-by: Aapo Alasuutari <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unhandled rejection when aborting cloned request with a static body
4 participants