Skip to content

Commit 38ecf0e

Browse files
committed
bitswap: reenable tests
This only enable tests that weren't always failing on CI.
1 parent 303595b commit 38ecf0e

22 files changed

+0
-347
lines changed

bitswap/bitswap_test.go

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ import (
1414
"github.com/ipfs/boxo/bitswap/server"
1515
testinstance "github.com/ipfs/boxo/bitswap/testinstance"
1616
tn "github.com/ipfs/boxo/bitswap/testnet"
17-
"github.com/ipfs/boxo/internal/test"
1817
mockrouting "github.com/ipfs/boxo/routing/mock"
1918
blocks "github.com/ipfs/go-block-format"
2019
cid "github.com/ipfs/go-cid"
@@ -49,8 +48,6 @@ func addBlock(t *testing.T, ctx context.Context, inst testinstance.Instance, blk
4948
const kNetworkDelay = 0 * time.Millisecond
5049

5150
func TestClose(t *testing.T) {
52-
test.Flaky(t)
53-
5451
vnet := tn.VirtualNetwork(mockrouting.NewServer(), delay.Fixed(kNetworkDelay))
5552
ig := testinstance.NewTestInstanceGenerator(vnet, nil, nil)
5653
defer ig.Close()
@@ -67,8 +64,6 @@ func TestClose(t *testing.T) {
6764
}
6865

6966
func TestProviderForKeyButNetworkCannotFind(t *testing.T) { // TODO revisit this
70-
test.Flaky(t)
71-
7267
rs := mockrouting.NewServer()
7368
net := tn.VirtualNetwork(rs, delay.Fixed(kNetworkDelay))
7469
ig := testinstance.NewTestInstanceGenerator(net, nil, nil)
@@ -94,8 +89,6 @@ func TestProviderForKeyButNetworkCannotFind(t *testing.T) { // TODO revisit this
9489
}
9590

9691
func TestGetBlockFromPeerAfterPeerAnnounces(t *testing.T) {
97-
test.Flaky(t)
98-
9992
net := tn.VirtualNetwork(mockrouting.NewServer(), delay.Fixed(kNetworkDelay))
10093
block := blocks.NewBlock([]byte("block"))
10194
ig := testinstance.NewTestInstanceGenerator(net, nil, nil)
@@ -124,8 +117,6 @@ func TestGetBlockFromPeerAfterPeerAnnounces(t *testing.T) {
124117
}
125118

126119
func TestDoesNotProvideWhenConfiguredNotTo(t *testing.T) {
127-
test.Flaky(t)
128-
129120
net := tn.VirtualNetwork(mockrouting.NewServer(), delay.Fixed(kNetworkDelay))
130121
block := blocks.NewBlock([]byte("block"))
131122
bsOpts := []bitswap.Option{bitswap.ProvideEnabled(false), bitswap.ProviderSearchDelay(50 * time.Millisecond)}
@@ -158,8 +149,6 @@ func TestDoesNotProvideWhenConfiguredNotTo(t *testing.T) {
158149
// Tests that a received block is not stored in the blockstore if the block was
159150
// not requested by the client
160151
func TestUnwantedBlockNotAdded(t *testing.T) {
161-
test.Flaky(t)
162-
163152
net := tn.VirtualNetwork(mockrouting.NewServer(), delay.Fixed(kNetworkDelay))
164153
block := blocks.NewBlock([]byte("block"))
165154
bsMessage := bsmsg.New(true)
@@ -195,8 +184,6 @@ func TestUnwantedBlockNotAdded(t *testing.T) {
195184
//
196185
// (because the live request queue is full)
197186
func TestPendingBlockAdded(t *testing.T) {
198-
test.Flaky(t)
199-
200187
ctx := context.Background()
201188
net := tn.VirtualNetwork(mockrouting.NewServer(), delay.Fixed(kNetworkDelay))
202189
bg := blocksutil.NewBlockGenerator()
@@ -245,8 +232,6 @@ func TestPendingBlockAdded(t *testing.T) {
245232
}
246233

247234
func TestLargeSwarm(t *testing.T) {
248-
test.Flaky(t)
249-
250235
if testing.Short() {
251236
t.SkipNow()
252237
}
@@ -279,8 +264,6 @@ func TestLargeFile(t *testing.T) {
279264
}
280265

281266
func TestLargeFileTwoPeers(t *testing.T) {
282-
test.Flaky(t)
283-
284267
if testing.Short() {
285268
t.SkipNow()
286269
}
@@ -290,8 +273,6 @@ func TestLargeFileTwoPeers(t *testing.T) {
290273
}
291274

292275
func PerformDistributionTest(t *testing.T, numInstances, numBlocks int) {
293-
test.Flaky(t)
294-
295276
ctx := context.Background()
296277
if testing.Short() {
297278
t.SkipNow()
@@ -349,8 +330,6 @@ func PerformDistributionTest(t *testing.T, numInstances, numBlocks int) {
349330

350331
// TODO simplify this test. get to the _essence_!
351332
func TestSendToWantingPeer(t *testing.T) {
352-
test.Flaky(t)
353-
354333
if testing.Short() {
355334
t.SkipNow()
356335
}
@@ -393,8 +372,6 @@ func TestSendToWantingPeer(t *testing.T) {
393372
}
394373

395374
func TestEmptyKey(t *testing.T) {
396-
test.Flaky(t)
397-
398375
net := tn.VirtualNetwork(mockrouting.NewServer(), delay.Fixed(kNetworkDelay))
399376
ig := testinstance.NewTestInstanceGenerator(net, nil, nil)
400377
defer ig.Close()
@@ -428,8 +405,6 @@ func assertStat(t *testing.T, st *bitswap.Stat, sblks, rblks, sdata, rdata uint6
428405
}
429406

430407
func TestBasicBitswap(t *testing.T) {
431-
test.Flaky(t)
432-
433408
net := tn.VirtualNetwork(mockrouting.NewServer(), delay.Fixed(kNetworkDelay))
434409
ig := testinstance.NewTestInstanceGenerator(net, nil, nil)
435410
defer ig.Close()
@@ -502,8 +477,6 @@ func TestBasicBitswap(t *testing.T) {
502477
}
503478

504479
func TestDoubleGet(t *testing.T) {
505-
test.Flaky(t)
506-
507480
net := tn.VirtualNetwork(mockrouting.NewServer(), delay.Fixed(kNetworkDelay))
508481
ig := testinstance.NewTestInstanceGenerator(net, nil, nil)
509482
defer ig.Close()
@@ -569,8 +542,6 @@ func TestDoubleGet(t *testing.T) {
569542
}
570543

571544
func TestWantlistCleanup(t *testing.T) {
572-
test.Flaky(t)
573-
574545
net := tn.VirtualNetwork(mockrouting.NewServer(), delay.Fixed(kNetworkDelay))
575546
ig := testinstance.NewTestInstanceGenerator(net, nil, nil)
576547
defer ig.Close()
@@ -693,8 +664,6 @@ func newReceipt(sent, recv, exchanged uint64) *server.Receipt {
693664
}
694665

695666
func TestBitswapLedgerOneWay(t *testing.T) {
696-
test.Flaky(t)
697-
698667
net := tn.VirtualNetwork(mockrouting.NewServer(), delay.Fixed(kNetworkDelay))
699668
ig := testinstance.NewTestInstanceGenerator(net, nil, nil)
700669
defer ig.Close()
@@ -744,8 +713,6 @@ func TestBitswapLedgerOneWay(t *testing.T) {
744713
}
745714

746715
func TestBitswapLedgerTwoWay(t *testing.T) {
747-
test.Flaky(t)
748-
749716
net := tn.VirtualNetwork(mockrouting.NewServer(), delay.Fixed(kNetworkDelay))
750717
ig := testinstance.NewTestInstanceGenerator(net, nil, nil)
751718
defer ig.Close()
@@ -834,8 +801,6 @@ func (tsl *testingScoreLedger) Stop() {
834801

835802
// Tests start and stop of a custom decision logic
836803
func TestWithScoreLedger(t *testing.T) {
837-
test.Flaky(t)
838-
839804
tsl := newTestingScoreLedger()
840805
net := tn.VirtualNetwork(mockrouting.NewServer(), delay.Fixed(kNetworkDelay))
841806
bsOpts := []bitswap.Option{bitswap.WithScoreLedger(tsl)}

bitswap/client/bitswap_with_sessions_test.go

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import (
1111
"github.com/ipfs/boxo/bitswap/client/traceability"
1212
testinstance "github.com/ipfs/boxo/bitswap/testinstance"
1313
tn "github.com/ipfs/boxo/bitswap/testnet"
14-
"github.com/ipfs/boxo/internal/test"
1514
mockrouting "github.com/ipfs/boxo/routing/mock"
1615
blocks "github.com/ipfs/go-block-format"
1716
cid "github.com/ipfs/go-cid"
@@ -40,8 +39,6 @@ func addBlock(t *testing.T, ctx context.Context, inst testinstance.Instance, blk
4039
}
4140

4241
func TestBasicSessions(t *testing.T) {
43-
test.Flaky(t)
44-
4542
ctx, cancel := context.WithCancel(context.Background())
4643
defer cancel()
4744

@@ -109,8 +106,6 @@ func assertBlockListsFrom(from peer.ID, got, exp []blocks.Block) error {
109106
}
110107

111108
func TestSessionBetweenPeers(t *testing.T) {
112-
test.Flaky(t)
113-
114109
ctx, cancel := context.WithCancel(context.Background())
115110
defer cancel()
116111

@@ -171,8 +166,6 @@ func TestSessionBetweenPeers(t *testing.T) {
171166
}
172167

173168
func TestSessionSplitFetch(t *testing.T) {
174-
test.Flaky(t)
175-
176169
ctx, cancel := context.WithCancel(context.Background())
177170
defer cancel()
178171

@@ -217,8 +210,6 @@ func TestSessionSplitFetch(t *testing.T) {
217210
}
218211

219212
func TestFetchNotConnected(t *testing.T) {
220-
test.Flaky(t)
221-
222213
ctx, cancel := context.WithTimeout(context.Background(), 2*time.Second)
223214
defer cancel()
224215

@@ -262,8 +253,6 @@ func TestFetchNotConnected(t *testing.T) {
262253
}
263254

264255
func TestFetchAfterDisconnect(t *testing.T) {
265-
test.Flaky(t)
266-
267256
ctx, cancel := context.WithTimeout(context.Background(), 2*time.Second)
268257
defer cancel()
269258

@@ -342,8 +331,6 @@ func TestFetchAfterDisconnect(t *testing.T) {
342331
}
343332

344333
func TestInterestCacheOverflow(t *testing.T) {
345-
test.Flaky(t)
346-
347334
ctx, cancel := context.WithCancel(context.Background())
348335
defer cancel()
349336

@@ -394,8 +381,6 @@ func TestInterestCacheOverflow(t *testing.T) {
394381
}
395382

396383
func TestPutAfterSessionCacheEvict(t *testing.T) {
397-
test.Flaky(t)
398-
399384
ctx, cancel := context.WithCancel(context.Background())
400385
defer cancel()
401386

@@ -434,8 +419,6 @@ func TestPutAfterSessionCacheEvict(t *testing.T) {
434419
}
435420

436421
func TestMultipleSessions(t *testing.T) {
437-
test.Flaky(t)
438-
439422
ctx, cancel := context.WithCancel(context.Background())
440423
defer cancel()
441424

@@ -477,8 +460,6 @@ func TestMultipleSessions(t *testing.T) {
477460
}
478461

479462
func TestWantlistClearsOnCancel(t *testing.T) {
480-
test.Flaky(t)
481-
482463
ctx, cancel := context.WithTimeout(context.Background(), time.Second*5)
483464
defer cancel()
484465

bitswap/client/internal/blockpresencemanager/blockpresencemanager_test.go

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import (
44
"testing"
55

66
"github.com/ipfs/boxo/bitswap/internal/testutil"
7-
"github.com/ipfs/boxo/internal/test"
87
cid "github.com/ipfs/go-cid"
98
peer "github.com/libp2p/go-libp2p/core/peer"
109
)
@@ -17,8 +16,6 @@ const (
1716
)
1817

1918
func TestBlockPresenceManager(t *testing.T) {
20-
test.Flaky(t)
21-
2219
bpm := New()
2320

2421
p := testutil.GeneratePeers(1)[0]
@@ -99,8 +96,6 @@ func TestBlockPresenceManager(t *testing.T) {
9996
}
10097

10198
func TestAddRemoveMulti(t *testing.T) {
102-
test.Flaky(t)
103-
10499
bpm := New()
105100

106101
peers := testutil.GeneratePeers(2)
@@ -184,8 +179,6 @@ func TestAddRemoveMulti(t *testing.T) {
184179
}
185180

186181
func TestAllPeersDoNotHaveBlock(t *testing.T) {
187-
test.Flaky(t)
188-
189182
bpm := New()
190183

191184
peers := testutil.GeneratePeers(3)

bitswap/client/internal/messagequeue/donthavetimeoutmgr_test.go

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import (
99

1010
"github.com/benbjohnson/clock"
1111
"github.com/ipfs/boxo/bitswap/internal/testutil"
12-
"github.com/ipfs/boxo/internal/test"
1312
cid "github.com/ipfs/go-cid"
1413
"github.com/libp2p/go-libp2p/p2p/protocol/ping"
1514
)
@@ -74,8 +73,6 @@ func (tr *timeoutRecorder) clear() {
7473
}
7574

7675
func TestDontHaveTimeoutMgrTimeout(t *testing.T) {
77-
test.Flaky(t)
78-
7976
firstks := testutil.GenerateCids(2)
8077
secondks := append(firstks, testutil.GenerateCids(3)...)
8178
latency := time.Millisecond * 20
@@ -132,8 +129,6 @@ func TestDontHaveTimeoutMgrTimeout(t *testing.T) {
132129
}
133130

134131
func TestDontHaveTimeoutMgrCancel(t *testing.T) {
135-
test.Flaky(t)
136-
137132
ks := testutil.GenerateCids(3)
138133
latency := time.Millisecond * 10
139134
latMultiplier := 1
@@ -170,8 +165,6 @@ func TestDontHaveTimeoutMgrCancel(t *testing.T) {
170165
}
171166

172167
func TestDontHaveTimeoutWantCancelWant(t *testing.T) {
173-
test.Flaky(t)
174-
175168
ks := testutil.GenerateCids(3)
176169
latency := time.Millisecond * 20
177170
latMultiplier := 1
@@ -225,8 +218,6 @@ func TestDontHaveTimeoutWantCancelWant(t *testing.T) {
225218
}
226219

227220
func TestDontHaveTimeoutRepeatedAddPending(t *testing.T) {
228-
test.Flaky(t)
229-
230221
ks := testutil.GenerateCids(10)
231222
latency := time.Millisecond * 5
232223
latMultiplier := 1
@@ -260,8 +251,6 @@ func TestDontHaveTimeoutRepeatedAddPending(t *testing.T) {
260251
}
261252

262253
func TestDontHaveTimeoutMgrMessageLatency(t *testing.T) {
263-
test.Flaky(t)
264-
265254
ks := testutil.GenerateCids(2)
266255
latency := time.Millisecond * 40
267256
latMultiplier := 1
@@ -311,8 +300,6 @@ func TestDontHaveTimeoutMgrMessageLatency(t *testing.T) {
311300
}
312301

313302
func TestDontHaveTimeoutMgrMessageLatencyMax(t *testing.T) {
314-
test.Flaky(t)
315-
316303
ks := testutil.GenerateCids(2)
317304
clock := clock.NewMock()
318305
pinged := make(chan struct{})
@@ -346,8 +333,6 @@ func TestDontHaveTimeoutMgrMessageLatencyMax(t *testing.T) {
346333
}
347334

348335
func TestDontHaveTimeoutMgrUsesDefaultTimeoutIfPingError(t *testing.T) {
349-
test.Flaky(t)
350-
351336
ks := testutil.GenerateCids(2)
352337
latency := time.Millisecond * 1
353338
latMultiplier := 2
@@ -389,8 +374,6 @@ func TestDontHaveTimeoutMgrUsesDefaultTimeoutIfPingError(t *testing.T) {
389374
}
390375

391376
func TestDontHaveTimeoutMgrUsesDefaultTimeoutIfLatencyLonger(t *testing.T) {
392-
test.Flaky(t)
393-
394377
ks := testutil.GenerateCids(2)
395378
latency := time.Millisecond * 200
396379
latMultiplier := 1
@@ -431,8 +414,6 @@ func TestDontHaveTimeoutMgrUsesDefaultTimeoutIfLatencyLonger(t *testing.T) {
431414
}
432415

433416
func TestDontHaveTimeoutNoTimeoutAfterShutdown(t *testing.T) {
434-
test.Flaky(t)
435-
436417
ks := testutil.GenerateCids(2)
437418
latency := time.Millisecond * 10
438419
latMultiplier := 1

0 commit comments

Comments
 (0)