ipfs / go-bitswap

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

Fix flaky DontHaveTimeoutManger tests #495

Closed hannahhoward closed 3 years ago

hannahhoward commented 3 years ago

Goals

Fix flaky tests for the DontHaveTimeoutManger

Implementation

Replace clock with a mock, so that we are able to mock out time in tests, modify tests to use mock time and be more predictable.

Also avoid AfterFunc cause of potential problems with channel consumption.

hannahhoward commented 3 years ago

Part of ipfs/go-libipfs#86

Stebalien commented 3 years ago

These tests appear to be passing now.