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

bug: python's test doesn't use reader correctly #4990

Closed
1 task
Xuanwo opened this issue Aug 9, 2024 · 3 comments · Fixed by #4995
Closed
1 task

bug: python's test doesn't use reader correctly #4990

Xuanwo opened this issue Aug 9, 2024 · 3 comments · Fixed by #4995
Labels
bindings/python bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed

Comments

@Xuanwo
Copy link
Member

Xuanwo commented Aug 9, 2024

Describe the bug

with operator.open(filename, "rb") as reader:
assert reader.readable()
assert not reader.writable()
assert not reader.closed
read_content = reader.read()
assert read_content is not None
assert read_content == content
with operator.open(filename, "rb") as reader:
read_content = reader.read(size + 1)
assert read_content is not None
assert read_content == content

There is no guarantee that read will always fill the read size. Users should keep calling read until EOF.

Steps to Reproduce

https://github.com/apache/opendal/actions/runs/10321553970/job/28574789953?pr=4989

The content is short than expected.

Expected Behavior

This test should pass stably.

Additional Context

No response

Are you willing to submit a PR to fix this bug?

  • Yes, I would like to submit a PR.
@Xuanwo Xuanwo added bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed bindings/python labels Aug 9, 2024
Bicheka added a commit to Bicheka/opendal that referenced this issue Aug 10, 2024
@Bicheka
Copy link
Contributor

Bicheka commented Aug 10, 2024

@Xuanwo I tried to fix it checking by chunks check PR

@shaikhmudassir
Copy link

@Xuanwo @Bicheka Can you please help me to regenerate the bug?

@Xuanwo
Copy link
Member Author

Xuanwo commented Aug 11, 2024

@Xuanwo @Bicheka Can you please help me to regenerate the bug?

Hi, there is no reliable way to reproduce this bug. It occurs when the storage fails to provide enough buffers.

Bicheka added a commit to Bicheka/opendal that referenced this issue Aug 11, 2024
@Xuanwo Xuanwo closed this as completed in ea11730 Aug 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bindings/python bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants