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(lib-storage): chunk from readable only when defined #1886

Merged
merged 3 commits into from
Jan 8, 2021

Conversation

alexforsyth
Copy link
Contributor

@alexforsyth alexforsyth commented Jan 8, 2021

Issue #, if available:
Unit tests for lib/storage are broken on node 12+, they work in node 10. The root cause is a minor difference in how readable works in node 12+.

Description of changes:
The functionality of readable differs slightly between node 10 and node 12+. This results in stream.on("end", () => { listener never being called in node 12+ but always being called in node 10. Due to this, chunking never actually ends in node 12+. The unit tests catch this and complain when being run in node 12+.

I've fixed the code to rely on streamreader.readable for end-state. This should work in both node 10 and node 12+ now.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@codecov-io
Copy link

codecov-io commented Jan 8, 2021

Codecov Report

Merging #1886 (4b26e87) into master (f2a47e8) will increase coverage by 0.00%.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1886   +/-   ##
=======================================
  Coverage   79.30%   79.31%           
=======================================
  Files         368      368           
  Lines       15132    15157   +25     
  Branches     3222     3236   +14     
=======================================
+ Hits        12001    12022   +21     
- Misses       3131     3135    +4     
Impacted Files Coverage Δ
packages/util-waiter/src/utils/validate.ts 81.81% <0.00%> (-18.19%) ⬇️
lib/storage/src/data-chunk/readable-helper.ts 86.84% <0.00%> (-5.47%) ⬇️
packages/util-dynamodb/src/convertToAttr.ts 98.70% <0.00%> (-1.30%) ⬇️
packages/util-waiter/src/waiter.ts 100.00% <0.00%> (ø)
protocol_tests/aws-ec2/endpoints.ts 81.48% <0.00%> (ø)
protocol_tests/aws-json/endpoints.ts 81.48% <0.00%> (ø)
protocol_tests/aws-query/endpoints.ts 81.48% <0.00%> (ø)
packages/util-dynamodb/src/marshall.ts 100.00% <0.00%> (ø)
protocol_tests/aws-restxml/endpoints.ts 81.48% <0.00%> (ø)
protocol_tests/aws-restjson/endpoints.ts 81.48% <0.00%> (ø)
... and 10 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update fc22682...4b26e87. Read the comment docs.

@aws-sdk-js-automation
Copy link

AWS CodeBuild CI Report

  • CodeBuild project: sdk-staging-test
  • Commit ID: 4b26e87
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@alexforsyth alexforsyth changed the title fix(lib-storage): fix readable chunking to work with node 12+ readable interface fix(lib-storage): chunk from readable only when defined Jan 8, 2021
@AllanZhengYP AllanZhengYP merged commit 4cdc08a into aws:master Jan 8, 2021
@github-actions
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 23, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants