@@ -69,7 +69,7 @@ func TestNormalSimultaneousFetch(t *testing.T) {
69
69
providerQueryManager .Startup ()
70
70
keys := testutil .GenerateCids (2 )
71
71
72
- sessionCtx , cancel := context .WithTimeout (ctx , 100 * time .Millisecond )
72
+ sessionCtx , cancel := context .WithTimeout (ctx , 5 * time .Second )
73
73
defer cancel ()
74
74
firstRequestChan := providerQueryManager .FindProvidersAsync (sessionCtx , keys [0 ])
75
75
secondRequestChan := providerQueryManager .FindProvidersAsync (sessionCtx , keys [1 ])
@@ -107,7 +107,7 @@ func TestDedupingProviderRequests(t *testing.T) {
107
107
providerQueryManager .Startup ()
108
108
key := testutil .GenerateCids (1 )[0 ]
109
109
110
- sessionCtx , cancel := context .WithTimeout (ctx , 100 * time .Millisecond )
110
+ sessionCtx , cancel := context .WithTimeout (ctx , 5 * time .Second )
111
111
defer cancel ()
112
112
firstRequestChan := providerQueryManager .FindProvidersAsync (sessionCtx , key )
113
113
secondRequestChan := providerQueryManager .FindProvidersAsync (sessionCtx , key )
@@ -152,7 +152,7 @@ func TestCancelOneRequestDoesNotTerminateAnother(t *testing.T) {
152
152
firstSessionCtx , firstCancel := context .WithTimeout (ctx , 3 * time .Millisecond )
153
153
defer firstCancel ()
154
154
firstRequestChan := providerQueryManager .FindProvidersAsync (firstSessionCtx , key )
155
- secondSessionCtx , secondCancel := context .WithTimeout (ctx , 100 * time .Millisecond )
155
+ secondSessionCtx , secondCancel := context .WithTimeout (ctx , 5 * time .Second )
156
156
defer secondCancel ()
157
157
secondRequestChan := providerQueryManager .FindProvidersAsync (secondSessionCtx , key )
158
158
@@ -262,7 +262,7 @@ func TestRateLimitingRequests(t *testing.T) {
262
262
providerQueryManager .Startup ()
263
263
264
264
keys := testutil .GenerateCids (maxInProcessRequests + 1 )
265
- sessionCtx , cancel := context .WithTimeout (ctx , 100 * time .Millisecond )
265
+ sessionCtx , cancel := context .WithTimeout (ctx , 5 * time .Second )
266
266
defer cancel ()
267
267
var requestChannels []<- chan peer.ID
268
268
for i := 0 ; i < maxInProcessRequests + 1 ; i ++ {
@@ -283,6 +283,7 @@ func TestRateLimitingRequests(t *testing.T) {
283
283
fpn .queriesMadeMutex .Lock ()
284
284
defer fpn .queriesMadeMutex .Unlock ()
285
285
if fpn .queriesMade != maxInProcessRequests + 1 {
286
+ t .Logf ("Queries made: %d\n " , fpn .queriesMade )
286
287
t .Fatal ("Did not make all seperate requests" )
287
288
}
288
289
}
@@ -291,15 +292,15 @@ func TestFindProviderTimeout(t *testing.T) {
291
292
peers := testutil .GeneratePeers (10 )
292
293
fpn := & fakeProviderNetwork {
293
294
peersFound : peers ,
294
- delay : 1 * time .Millisecond ,
295
+ delay : 10 * time .Millisecond ,
295
296
}
296
297
ctx := context .Background ()
297
298
providerQueryManager := New (ctx , fpn )
298
299
providerQueryManager .Startup ()
299
300
providerQueryManager .SetFindProviderTimeout (2 * time .Millisecond )
300
301
keys := testutil .GenerateCids (1 )
301
302
302
- sessionCtx , cancel := context .WithTimeout (ctx , 100 * time .Millisecond )
303
+ sessionCtx , cancel := context .WithTimeout (ctx , 5 * time .Second )
303
304
defer cancel ()
304
305
firstRequestChan := providerQueryManager .FindProvidersAsync (sessionCtx , keys [0 ])
305
306
var firstPeersReceived []peer.ID
0 commit comments