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

Trustless Gateway: "GET CAR with entity-bytes requesting a range from the end of a file" test expects in correct behavior #189

Closed
hannahhoward opened this issue Dec 8, 2023 · 1 comment · Fixed by #190
Assignees

Comments

@hannahhoward
Copy link
Contributor

What

This test reads a file with an entity-bytes param from the -99999 index (i.e. beginning of the file) up to the -3 index (i.e. everything but the last two bytes).

The expectations as written appear to be testing that all but the last block of the generated car file are returned:
https://github.com/ipfs/gateway-conformance/blob/main/tests/trustless_gateway_car_test.go#L637

However, if one looks at the underlying file, https://github.com/ipfs/gateway-conformance/blob/main/fixtures/trustless_gateway_car/subdir-with-mixed-block-files.car, via CAR inspection, one funds the underlying file is 4098 bytes long, with each block 1024 bytes, for 4 1024 blocks and 1 2 byte block to complete the file. So it has a total of 5 blocks.

Meaning that https://github.com/ipfs/gateway-conformance/blob/main/tests/trustless_gateway_car_test.go#L637 as written is actually expecting the whole file to be read, which is incorrect behavior.

The reason it passes for boxo is due to a seperate bug -- ipfs/boxo#523

@lidel
Copy link
Member

lidel commented Dec 12, 2023

Thank you for reporting and taking time to provide PRs with fixes @hannahhoward.

Will bring this up during triage and will prioritize reviews
(realistically, after tasks related to ipfs/kubo#10045 are wrapped up, but before EOW)

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 a pull request may close this issue.

2 participants