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(types): fix flaky blob reconstruct when len == 0 #541

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

zvolin
Copy link
Member

@zvolin zvolin commented Feb 12, 2025

No description provided.

@zvolin zvolin requested review from oblique and fl0rek February 12, 2025 13:48
@zvolin zvolin force-pushed the fix/flaky-blob-reconstruct-test branch from 909679d to bf6f195 Compare February 12, 2025 13:51
@@ -489,7 +489,7 @@ mod tests {

#[test]
fn reconstruct_not_sequence_start() {
let len = rand::random::<usize>() % 1024 * 1024;
let len = rand::random::<usize>() % (1024 * 1024) + 1;
Copy link
Member

@fl0rek fl0rek Feb 12, 2025

Choose a reason for hiding this comment

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

after double checking operator precedence etc.. maybe it could be just:

Suggested change
let len = rand::random::<usize>() % (1024 * 1024) + 1;
let len : usize = rand::random_range(1..=(1024*1024) + 1);

Upper and lower limits are immediately visible this way, no need to do the maths. Similarly those below.

Copy link
Member Author

Choose a reason for hiding this comment

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

sounds good, but for this we'd need to upgrade rand

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.

3 participants