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

test(cbor): empty string being excluded from expected result #6106

Merged
merged 2 commits into from
Oct 13, 2024

Conversation

BlackAsLight
Copy link
Contributor

Closes: #6102

The expected result was filtering out empty strings provided in the input text, while CborTextEncoderStream doesn't remove them. The test appeared flaky because of the randomness of the test. In the event the first random chose zero (which is a 1 in 24 chance), an empty string would be one of the chunks. An empty string is encoded as byte 96.

Lowering the size of the strings had no effect on the flakiness of the tests, but I am assuming that's why they were lowered in the first place.

@BlackAsLight BlackAsLight requested a review from kt3k as a code owner October 11, 2024 02:24
@github-actions github-actions bot added the cbor label Oct 11, 2024
Copy link

codecov bot commented Oct 11, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.57%. Comparing base (a4cd8af) to head (e407c93).
Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6106      +/-   ##
==========================================
+ Coverage   96.55%   96.57%   +0.02%     
==========================================
  Files         534      534              
  Lines       40589    40589              
  Branches     6093     6095       +2     
==========================================
+ Hits        39190    39199       +9     
+ Misses       1355     1346       -9     
  Partials       44       44              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@kt3k
Copy link
Member

kt3k commented Oct 13, 2024

The expected result was filtering out empty strings provided in the input text, while CborTextEncoderStream doesn't remove them. The test appeared flaky because of the randomness of the test. In the event the first random chose zero (which is a 1 in 24 chance), an empty string would be one of the chunks. An empty string is encoded as byte 96.

Thanks for looking into this!

Copy link
Member

@kt3k kt3k left a comment

Choose a reason for hiding this comment

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

LGTM

@kt3k kt3k changed the title fix(cbor): empty string being excluded from expected result test(cbor): empty string being excluded from expected result Oct 13, 2024
@kt3k kt3k merged commit 3927872 into denoland:main Oct 13, 2024
20 checks passed
@BlackAsLight BlackAsLight deleted the cbor_text_encoding_stream branch October 13, 2024 04:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enable test of CborTextEncoderStream()
2 participants