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

Add additional WriteMultipart tests (#5743) #5746

Merged
merged 2 commits into from
May 11, 2024

Conversation

tustvold
Copy link
Contributor

Which issue does this PR close?

Closes #5743

Rationale for this change

It makes me rather uncomfortable that #5743 managed to slip through our testing coverage. Therefore this PR further extends the test coverage, beyond the limited tests added in #5744.

What changes are included in this PR?

Are there any user-facing changes?

@github-actions github-actions bot added the object-store Object Store Interface label May 10, 2024
Copy link
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

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

Looks good to me -- I have one other suggestion for a test improvement, but 🚀


let chunks = chunks.lock();

let actual: Vec<_> = chunks.iter().flatten().flatten().copied().collect();
Copy link
Contributor

Choose a reason for hiding this comment

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

Could we also please add a check here that the chunks are actually the expected sizes? I am imagining what if new_with_chunk_size didn't actually cause multiple chunks to be written?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There is a check for this two lines below?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes you are right -- sorry I missed that

I was thinking that for chunk in chunks.iter().take(chunks.len() - 1) { would work even if there were only one chunk. However, I see now that assert_eq!(chunk.content_length(), chunk_size) verifies that each chunk is exactly chunk_size bytes so if for example new_with_chunks_size hadn't worked, this assert would fail

@tustvold tustvold merged commit 7efe6c2 into apache:master May 11, 2024
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
object-store Object Store Interface
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Using WriteMultipart::put results in 0 bytes being written
2 participants