-
-
Notifications
You must be signed in to change notification settings - Fork 46
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
Polish test case for PR: replace into-stream
to Readable.from
#291
Polish test case for PR: replace into-stream
to Readable.from
#291
Conversation
I'd like to polish the test case @climba03003 and @mcollina create. But it's strage that your previous PR and this PR are failing at my local env. The length of input and output strings are completly mismatched |
1e6c3ab
to
ffe60f6
Compare
If I replace const response1 = await fetch(`${address}/compress`)
const response2 = await fetch(`${address}/no-compress`)
const body1 = await response1.text()
const body2 = await response2.text()
t.equal(body1, body2)
t.equal(body1.length, twoByteUnicodeContent.length)
t.equal(body2.length, twoByteUnicodeContent.length) Am I discovered an encoding issue for |
That's interesting node 14 doesn't support undici fetch I think... you might want to try |
I don't understand why it is strange on your environment. The test case works fine between different OS and Node versions. I have also tested on my local environment. |
@climba03003 I was going to ask if you had an idea on why So request didn't work: ffe60f6 And fetch did: c1882b9 |
Here are my thoughts of failing or not failing @climba03003 In my attached img, the input length (334k) and output length (284k) are not identical. (1) The previous PR you created, only checks the responses of compressed and uncompressed. They are identical on supported platforms (including my dev env1 - Win11), but for some reasons, not identical on my dev env2 - a legacy Windows. (2) In my PR, I check the input and output length in additional. That's why it is failed. (3) (4) The core implementation of your previous PR is proven functional |
Co-authored-by: Gürgün Dayıoğlu <hey@gurgun.day> Signed-off-by: Qian (Stanley) Xu <stanleyxu2005@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use use my test. undici.fetch() correctly decode this. undici.request() for some reason does not. I'll open an issue.
Use undici@5.
@mcollina undici fetch doesn’t work on node 14 I think, do you know if that’s the case? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
You are right, there is no web streams in node v14. |
Checklist
npm run test
andnpm run benchmark
and the Code of conduct