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

[ipfs/go-bitswap] Invariant Testing #127

Open
Stebalien opened this issue Mar 6, 2020 · 0 comments
Open

[ipfs/go-bitswap] Invariant Testing #127

Stebalien opened this issue Mar 6, 2020 · 0 comments
Labels
kind/test Testing work

Comments

@Stebalien
Copy link
Member

Stebalien commented Mar 6, 2020

Given the complexity of bitswap, we should add some invariant testing. I'm thinking something like:

  • Log all events (using zap):
    • want(type/cancel) sent for X, to peer Y, as part of session Z/broadcast
    • want(type/cancel) received for X, from peer Y.
    • sent X to peer Y, responding to want of TYPE.
    • receive block/want-have/dont-want for X from peer Y in sessions Z(s).
    • peer added/removed to/from session
    • latency determined
    • timeouts
  • Process the events after the fact to make sure we:
    • Don't send wants for things we have.
    • Send cancels.
    • Send want/haves once.
    • Don't timeout waiting for something we shouldn't have waited on.
      • E.g., peer sent us something and we still process a timeout for it.
    • Etc...

The goal is not to modify the existing tests, just to make sure we aren't violating any invariants when running them. Fortunately for the network, and unfortunately for testing, bitswap is pretty robust against errors so many tests are likely to continue succeeding even when we've technically broken something.

@Stebalien Stebalien added the kind/test Testing work label Mar 6, 2020
@Jorropo Jorropo changed the title Invariant Testing [ipfs/go-bitswap] Invariant Testing Jan 27, 2023
@Jorropo Jorropo transferred this issue from ipfs/go-bitswap Jan 27, 2023
Jorropo pushed a commit to ipfs/go-libipfs-rapide that referenced this issue Mar 23, 2023
* Fix panic when childer is nil

Signed-off-by: Antonio Navarro Perez <[email protected]>

* Apply suggestions from code review

Co-authored-by: Gus Eggert <[email protected]>

Signed-off-by: Antonio Navarro Perez <[email protected]>
Co-authored-by: Gus Eggert <[email protected]>

This commit was moved from ipfs/go-unixfs@fede2ed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/test Testing work
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant