@cryptotaxi247 / kubo / commits / cfd7d5369

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>

Brian Tiger Chow committed Nov 18, 2014 at 21:52 UTC cfd7d5369b5b442a9001f0faae111ddead4b63aa
1 file changed +5 -1
exchange/bitswap/bitswap_test.go
+5 -1
@@ -152,6 +152,10 @@ func getOrFail(bitswap instance, b *blocks.Block, t *testing.T, wg *sync.WaitGro
152
153 // TODO simplify this test. get to the _essence_!
154 func TestSendToWantingPeer(t *testing.T) {
155 + if testing.Short() {
156 + t.SkipNow()
157 + }
158 +
159 net := tn.VirtualNetwork()
160 rs := mock.VirtualRoutingServer()
161 sg := NewSessionGenerator(net, rs)
@@ -167,7 +171,7 @@ func TestSendToWantingPeer(t *testing.T) {
171
172 alpha := bg.Next()
173
170 - const timeout = 1 * time.Millisecond // FIXME don't depend on time
174 + const timeout = 100 * time.Millisecond // FIXME don't depend on time
175
176 t.Logf("Peer %v attempts to get %v. NB: not available\n", w.peer, alpha.Key())
177 ctx, _ := context.WithTimeout(context.Background(), timeout)