5
5
const { getDescribe, getIt, expect } = require ( '../utils/mocha' )
6
6
const { waitForWantlistKey } = require ( './utils' )
7
7
8
+ const TIMEOUT = 120000
9
+
8
10
module . exports = ( createCommon , options ) => {
9
11
const describe = getDescribe ( options )
10
12
const it = getIt ( options )
@@ -21,26 +23,31 @@ module.exports = (createCommon, options) => {
21
23
this . timeout ( 60 * 1000 )
22
24
23
25
ipfsA = await common . setup ( )
24
- ipfsB = await common . setup ( )
26
+ ipfsB = await common . setup ( { factoryOptions : { type : 'go' } } )
25
27
26
28
// Add key to the wantlist for ipfsB
27
- ipfsB . block . get ( key , ( ) => { } )
29
+ ipfsB . block . get ( key ) . catch ( ( ) => { } )
28
30
29
31
await ipfsA . swarm . connect ( ipfsB . peerId . addresses [ 0 ] )
30
32
} )
31
33
32
34
after ( function ( ) {
33
- this . timeout ( 30 * 1000 )
35
+ this . timeout ( TIMEOUT )
34
36
35
37
return common . teardown ( )
36
38
} )
37
39
38
- it ( 'should get the wantlist' , ( ) => {
39
- return waitForWantlistKey ( ipfsB , key )
40
+ it ( 'should get the wantlist' , function ( ) {
41
+ this . timeout ( TIMEOUT )
42
+ return waitForWantlistKey ( ipfsB , key , { timeout : TIMEOUT } )
40
43
} )
41
44
42
- it ( 'should get the wantlist by peer ID for a diffreent node' , ( ) => {
43
- return waitForWantlistKey ( ipfsA , key , { peerId : ipfsB . peerId . id } )
45
+ it ( 'should get the wantlist by peer ID for a different node' , function ( ) {
46
+ this . timeout ( TIMEOUT )
47
+ return waitForWantlistKey ( ipfsA , key , {
48
+ peerId : ipfsB . peerId . id ,
49
+ timeout : TIMEOUT
50
+ } )
44
51
} )
45
52
46
53
it ( 'should not get the wantlist when offline' , async function ( ) {
@@ -49,7 +56,7 @@ module.exports = (createCommon, options) => {
49
56
const node = await createCommon ( ) . setup ( )
50
57
await node . stop ( )
51
58
52
- return expect ( node . bitswap . stat ( ) ) . to . eventually . be . rejected ( )
59
+ return expect ( node . bitswap . wantlist ( ) ) . to . eventually . be . rejected ( )
53
60
} )
54
61
} )
55
62
}
0 commit comments