protocol / beyond-bitswap

Other
34 stars 9 forks source link

Use TestFiles in Bitswap test #31

Closed hannahhoward closed 3 years ago

hannahhoward commented 3 years ago

Goals

Align usage of TestFiles in bitswap test with IPFS tests, permit network permutations across all tests and introduce default compositions.

Implementation

The biggest thing missing here is a way to add an arbitrary files.Node to a blockstore. Currently, this only exists in the IPFS core API. I went ahead and cribbed and simplified that to support adding random files, or real files and directories.

There is now a DAGAdder which will add an arbitrary files.Node using a ipld.DAGService

Additionally the configuration is now changed so that network parameters like latency, bandwidth and jitter can all be specified as an array so that each test will be run run_count times for each permutation of file, latency, bandwidth and jitter giving us a view into how the transport behaves across a range of conditions.

This also adds seeding to random file generation to ensure deterministic behavior across tests and avoid potential race conditions.

hannahhoward commented 3 years ago

@adlrocha this continues the march of unifying the way these tests work

adlrocha commented 3 years ago

Awesome job, @hannahhoward. I love how this is coming together. Thanks!

Two questions about this PR:

Everything else LGTM. So feel free merge 🚀

hannahhoward commented 3 years ago

@adlrocha

adlrocha commented 3 years ago

Sweet! I like the delta approach and thank you both for double checking the RFC experiments. I see that you have everything figured out 🙈

It is merging time! 🚀