ipfs / go-bitswap

The golang implementation of the bitswap protocol
MIT License
216 stars 112 forks source link

Fix TestSessionWithPeers flakiness #491

Closed hannahhoward closed 3 years ago

hannahhoward commented 3 years ago

Goals

fix #442

Implementation

The TestSessionWithPeers test was most commonly failing cause of a don't have timeout, which triggered simulated don't have message for all CIDs on the peer with content, which triggered a re-broadcast, causing peers with no content to receive additional wants.

This PR adds an option to not send these simulated don't have messages in tests.

dirkmc commented 3 years ago

Can we use the existing SetSendDontHaves option? https://github.com/ipfs/go-bitswap/pull/491/files#diff-9c62a707b27a6f011e3dab430c7920b8da5dc1a53c917cb7b2a32738dd77e98fR108

hannahhoward commented 3 years ago

@dirkmc -- that controls sending out don't haves -- do we want to consider that the same behavior as simulating incoming don't haves?

dirkmc commented 3 years ago

Ah yes you're right - I got confused by the name of the method. Suggest renaming to SetSimulateDontHavesOnTimeout

hannahhoward commented 3 years ago

done