mirror of
https://github.com/ipfs/kubo.git
synced 2026-03-06 16:58:11 +08:00
test(bitswap)
@whyrusleeping This appears to be a timing issue. The asynchronous nature of the new structure provides has the bitswap waiting on the context a bit more. This isn't a problem at all, but in this test, it makes the functions return in an inconveniently timely manner. TODO don't let the test depend on time. License: MIT Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
This commit is contained in:
parent
5dece164cc
commit
cfd7d5369b
@ -152,6 +152,10 @@ func getOrFail(bitswap instance, b *blocks.Block, t *testing.T, wg *sync.WaitGro
|
||||
|
||||
// TODO simplify this test. get to the _essence_!
|
||||
func TestSendToWantingPeer(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.SkipNow()
|
||||
}
|
||||
|
||||
net := tn.VirtualNetwork()
|
||||
rs := mock.VirtualRoutingServer()
|
||||
sg := NewSessionGenerator(net, rs)
|
||||
@ -167,7 +171,7 @@ func TestSendToWantingPeer(t *testing.T) {
|
||||
|
||||
alpha := bg.Next()
|
||||
|
||||
const timeout = 1 * time.Millisecond // FIXME don't depend on time
|
||||
const timeout = 100 * time.Millisecond // FIXME don't depend on time
|
||||
|
||||
t.Logf("Peer %v attempts to get %v. NB: not available\n", w.peer, alpha.Key())
|
||||
ctx, _ := context.WithTimeout(context.Background(), timeout)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user