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

feat: issue-75 - test entity-bytes with missing blocks #85

Merged
merged 6 commits into from
Jun 26, 2023

Conversation

laurentsenta
Copy link
Contributor

Closes #75

  • rename fixtures/t0118 to match the test name
  • MustGetChildren -> MustGetDescendants
  • Implement "real" MustListChildren
  • Generate a car file with missing blocks
  • Add two tests that try to query the beginning and end of a car file with missing blocks
  • Add a README.md with a recipe for the fixtures.

Copy link
Member

@lidel lidel left a comment

Choose a reason for hiding this comment

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

Thank you @laurentsenta, this is exactly what we needed!

(pushed some minor tweaks to Name and Hint + some comments inline fyi, but ok to merge as-is – we need this and to unblock filecoin-saturn/L1-node#447)

Comment on lines 441 to 442
{
Name: "GET CAR with entity-bytes when missing a block will timeout",
Copy link
Member

Choose a reason for hiding this comment

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

@laurentsenta (just FYI) I've removed this one, as its body was the same as the first one we had – assuming it was just left-over of some copy-paste.

I did not fix it to actually test timeout, because:

  • we don't want to introduce unnecessary latency to the test suite
  • the duration after which returning HTTP 504 is not currently specified, so we can't test conformance anyway
  • two existing tests are more than enough - especially entity-bytes=2200:* one – this alone will fail if implementation is broken the way I described in Add backend timeout test for entity-bytes from IPIP-402 #75

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the update and removing that useless test 🙏
I created an issue to add timeouts #89

assert.Len(t, cids, 3)
assert.Equal(t, "QmZgfvZtoFdbJy4JmpPHc1NCXyA7Snim2L8e6zKspiUzhu", cids[0])
assert.Equal(t, "QmaATBg1yioWhYHhoA8XSUqD1Ya91KKCibWVD4USQXwaVZ", cids[1])
assert.Equal(t, "QmdQEnYhrhgFKPCq5eKc7xb1k7rKyb3fGMitUPKvFAscVK", cids[2])
}

func TestMustGetChildrenDespiteMissingBlocks(t *testing.T) {
f := MustOpenUnixfsCar("./_fixtures/file-3k-and-3-blocks-missing-block.car")
Copy link
Member

Choose a reason for hiding this comment

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

💭 excellent call to have a separate fixture for testing tooling, independent of fixture used in actual gateway test 👌

Path("/ipfs/{{cid}}", missingBlockFixture.MustGetCidWithCodec(0x70)).
Query("format", "car").
Query("dag-scope", "entity").
Query("entity-bytes", "2200:*"),
Copy link
Member

Choose a reason for hiding this comment

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

ℹ️ I had gut feeling to check what we send on the wire – we may need to add QueryRaw here, but not in scope of this PR, not a blocker – filled separate #88

@laurentsenta laurentsenta mentioned this pull request Jun 26, 2023
2 tasks
@laurentsenta laurentsenta merged commit 43c0842 into main Jun 26, 2023
2 of 3 checks passed
@laurentsenta laurentsenta deleted the feat/issue-75-entity-bytes branch June 26, 2023 09:25
@laurentsenta laurentsenta mentioned this pull request Jun 26, 2023
2 tasks
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.

Add backend timeout test for entity-bytes from IPIP-402
4 participants