Skip to content

Commit d0c2820

Browse files
authored
chore: remove timeout tests (#226)
These have always been flaky and don't test anything to do with being an HTTP client so remove them.
1 parent 4b067e2 commit d0c2820

File tree

15 files changed

+1
-175
lines changed

15 files changed

+1
-175
lines changed

test/interface-tests/src/bitswap/wantlist.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import { CID } from 'multiformats/cid'
66
import { isWebWorker } from 'wherearewe'
77
import { ipfsOptionsWebsocketsFilterAll } from '../utils/ipfs-options-websockets-filter-all.js'
88
import { getDescribe, getIt, type MochaConfig } from '../utils/mocha.js'
9-
import testTimeout from '../utils/test-timeout.js'
109
import { waitForWantlistKey, waitForWantlistKeyToBeRemoved } from './utils.js'
1110
import type { KuboRPCClient } from '../../../../src/index.js'
1211
import type { KuboRPCFactory } from '../index.js'
@@ -39,12 +38,6 @@ export function testWantlist (factory: KuboRPCFactory, options: MochaConfig): vo
3938
await factory.clean()
4039
})
4140

42-
it('should respect timeout option when getting bitswap wantlist', async () => {
43-
return testTimeout(async () => ipfsA.bitswap.wantlist({
44-
timeout: 1
45-
}))
46-
})
47-
4841
it('should get the wantlist', async function () {
4942
return waitForWantlistKey(ipfsB, key)
5043
})

test/interface-tests/src/block/get.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import { CID } from 'multiformats/cid'
55
import { identity } from 'multiformats/hashes/identity'
66
import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string'
77
import { getDescribe, getIt, type MochaConfig } from '../utils/mocha.js'
8-
import testTimeout from '../utils/test-timeout.js'
98
import type { KuboRPCClient } from '../../../../src/index.js'
109
import type { KuboRPCFactory } from '../index.js'
1110

@@ -27,12 +26,6 @@ export function testGet (factory: KuboRPCFactory, options: MochaConfig): void {
2726
await factory.clean()
2827
})
2928

30-
it('should respect timeout option when getting a block', async () => {
31-
return testTimeout(async () => ipfs.block.get(CID.parse('QmPv52ekjS75L4JmHpXVeuJ5uX2ecSfSZo88NSyxwA3rA3'), {
32-
timeout: 1
33-
}))
34-
})
35-
3629
it('should get by CID', async () => {
3730
const block = await ipfs.block.get(cid)
3831

test/interface-tests/src/block/rm.ts

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import * as raw from 'multiformats/codecs/raw'
88
import { nanoid } from 'nanoid'
99
import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string'
1010
import { getDescribe, getIt, type MochaConfig } from '../utils/mocha.js'
11-
import testTimeout from '../utils/test-timeout.js'
1211
import type { KuboRPCClient } from '../../../../src/index.js'
1312
import type { KuboRPCFactory } from '../index.js'
1413

@@ -25,16 +24,6 @@ export function testRm (factory: KuboRPCFactory, options: MochaConfig): void {
2524
await factory.clean()
2625
})
2726

28-
it('should respect timeout option when removing a block', async function () {
29-
const cid = await ipfs.dag.put(uint8ArrayFromString(nanoid()), {
30-
storeCodec: 'raw',
31-
hashAlg: 'sha2-256'
32-
})
33-
await testTimeout(async () => ipfs.block.rm(CID.parse(cid.toString()), {
34-
timeout: 1
35-
}))
36-
})
37-
3827
it('should remove by CID object', async () => {
3928
const cid = await ipfs.dag.put(uint8ArrayFromString(nanoid()), {
4029
storeCodec: 'raw',

test/interface-tests/src/block/stat.ts

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
/* eslint-env mocha */
22

33
import { expect } from 'aegir/chai'
4-
import { CID } from 'multiformats/cid'
54
import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string'
65
import { getDescribe, getIt, type MochaConfig } from '../utils/mocha.js'
7-
import testTimeout from '../utils/test-timeout.js'
86
import type { KuboRPCClient } from '../../../../src/index.js'
97
import type { KuboRPCFactory } from '../index.js'
8+
import type { CID } from 'multiformats/cid'
109

1110
export function testStat (factory: KuboRPCFactory, options: MochaConfig): void {
1211
const describe = getDescribe(options)
@@ -26,12 +25,6 @@ export function testStat (factory: KuboRPCFactory, options: MochaConfig): void {
2625
await factory.clean()
2726
})
2827

29-
it('should respect timeout option when statting a block', async () => {
30-
return testTimeout(async () => ipfs.block.stat(CID.parse('QmVwdDCY4SPGVFnNCiZnX5CtzwWDn6kAM98JXzKxE3kCmn'), {
31-
timeout: 1
32-
}))
33-
})
34-
3528
it('should stat by CID', async () => {
3629
const stats = await ipfs.block.stat(cid)
3730
expect(stats.cid.toString()).to.equal(cid.toString())

test/interface-tests/src/cat.ts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,12 @@ import { expect } from 'aegir/chai'
44
import { importer } from 'ipfs-unixfs-importer'
55
import all from 'it-all'
66
import drain from 'it-drain'
7-
import { CID } from 'multiformats/cid'
87
import { concat as uint8ArrayConcat } from 'uint8arrays/concat'
98
import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string'
109
import { toString as uint8ArrayToString } from 'uint8arrays/to-string'
1110
import blockstore from './utils/blockstore-adapter.js'
1211
import { fixtures } from './utils/index.js'
1312
import { getDescribe, getIt, type MochaConfig } from './utils/mocha.js'
14-
import testTimeout from './utils/test-timeout.js'
1513
import type { KuboRPCFactory } from './index.js'
1614
import type { KuboRPCClient } from '../../../src/index.js'
1715

@@ -34,14 +32,6 @@ export function testCat (factory: KuboRPCFactory, options: MochaConfig): void {
3432
await factory.clean()
3533
})
3634

37-
it('should respect timeout option when catting files', async function () {
38-
await testTimeout(async () => {
39-
await drain(ipfs.cat(CID.parse('QmPDqvcuA4AkhBLBuh2y49yhUB98rCnxPxa3eVNC1kAbS1'), {
40-
timeout: 1
41-
}))
42-
})
43-
})
44-
4535
it('should export a chunk of a file', async function () {
4636
const offset = 1
4737
const length = 3

test/interface-tests/src/dag/get.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ import { sha256 } from 'multiformats/hashes/sha2'
1616
import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string'
1717
import blockstore from '../utils/blockstore-adapter.js'
1818
import { getDescribe, getIt, type MochaConfig } from '../utils/mocha.js'
19-
import testTimeout from '../utils/test-timeout.js'
2019
import type { KuboRPCClient } from '../../../../src/index.js'
2120
import type { KuboRPCFactory } from '../index.js'
2221

@@ -79,12 +78,6 @@ export function testGet (factory: KuboRPCFactory, options: MochaConfig): void {
7978
await ipfs.dag.put(nodeJose, { storeCodec: dagJOSE.name, hashAlg: 'sha2-256' })
8079
})
8180

82-
it('should respect timeout option when getting a DAG node', async () => {
83-
return testTimeout(async () => ipfs.dag.get(CID.parse('QmPv52ekjS75L4JmHpXVeuJ5uX2ecSfSZo88NSyxwA3rAd'), {
84-
timeout: 1
85-
}))
86-
})
87-
8881
it('should get a dag-pb node', async () => {
8982
const cid = await ipfs.dag.put(pbNode, {
9083
storeCodec: 'dag-pb',

test/interface-tests/src/dag/resolve.ts

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import * as dagPB from '@ipld/dag-pb'
44
import { expect } from 'aegir/chai'
55
import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string'
66
import { getDescribe, getIt, type MochaConfig } from '../utils/mocha.js'
7-
import testTimeout from '../utils/test-timeout.js'
87
import type { KuboRPCClient } from '../../../../src/index.js'
98
import type { KuboRPCFactory } from '../index.js'
109

@@ -21,14 +20,6 @@ export function testResolve (factory: KuboRPCFactory, options: MochaConfig): voi
2120
await factory.clean()
2221
})
2322

24-
it('should respect timeout option when resolving a path within a DAG node', async function () {
25-
const cid = await ipfs.dag.put({}, { storeCodec: 'dag-cbor', hashAlg: 'sha2-256' })
26-
27-
await testTimeout(async () => ipfs.dag.resolve(cid, {
28-
timeout: 1
29-
}))
30-
})
31-
3223
it('should resolve a path inside a cbor node', async () => {
3324
const obj = {
3425
a: 1,

test/interface-tests/src/dht/query.ts

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
/* eslint-env mocha */
22

33
import { expect } from 'aegir/chai'
4-
import drain from 'it-drain'
54
import { getDescribe, getIt, type MochaConfig } from '../utils/mocha.js'
6-
import testTimeout from '../utils/test-timeout.js'
75
import { ensureReachable } from './utils.js'
86
import type { KuboRPCClient } from '../../../../src/index.js'
97
import type { KuboRPCFactory } from '../index.js'
@@ -29,16 +27,6 @@ export function testQuery (factory: KuboRPCFactory, options: MochaConfig): void
2927
await factory.clean()
3028
})
3129

32-
it('should respect timeout option when querying the DHT', async () => {
33-
const nodeBId = await nodeB.id()
34-
35-
return testTimeout(async () => {
36-
return drain(nodeA.dht.query(nodeBId.id, {
37-
timeout: 1
38-
}))
39-
})
40-
})
41-
4230
it('should return the other node in the query', async function () {
4331
/** @type {string[]} */
4432
const peers = []

test/interface-tests/src/get.ts

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ import { toString as uint8ArrayToString } from 'uint8arrays/to-string'
1717
import blockstore from './utils/blockstore-adapter.js'
1818
import { fixtures } from './utils/index.js'
1919
import { getDescribe, getIt, type MochaConfig } from './utils/mocha.js'
20-
import testTimeout from './utils/test-timeout.js'
2120
import type { KuboRPCFactory } from './index.js'
2221
import type { KuboRPCClient } from '../../../src/index.js'
2322

@@ -94,14 +93,6 @@ export function testGet (factory: KuboRPCFactory, options: MochaConfig): void {
9493
})
9594

9695
describe('files', function () {
97-
it('should respect timeout option when getting files', async function () {
98-
await testTimeout(async () => {
99-
await drain(ipfs.get(CID.parse('QmPDqvcuA4AkhBLBuh2y49yhUB98rCnxPxa3eVNC1kAbS1'), {
100-
timeout: 1
101-
}))
102-
})
103-
})
104-
10596
it('should get with a base58 encoded multihash', async () => {
10697
const output = await pipe(
10798
ipfs.get(fixtures.smallFile.cid),

test/interface-tests/src/ls.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,8 @@
22

33
import { expect } from 'aegir/chai'
44
import all from 'it-all'
5-
import { CID } from 'multiformats/cid'
65
import { fixtures } from './utils/index.js'
76
import { getDescribe, getIt, type MochaConfig } from './utils/mocha.js'
8-
import testTimeout from './utils/test-timeout.js'
97
import type { KuboRPCFactory } from './index.js'
108
import type { KuboRPCClient } from '../../../src/index.js'
119
import type { ImportCandidate } from 'ipfs-unixfs-importer'
@@ -29,12 +27,6 @@ export function testLs (factory: KuboRPCFactory, options: MochaConfig): void {
2927
await factory.clean()
3028
})
3129

32-
it('should respect timeout option when listing files', async () => {
33-
return testTimeout(() => ipfs.ls(CID.parse('QmNonExistentCiD8Hrf4MHo5ABDtb5AbX6hWbD3Y42bXg'), {
34-
timeout: 1
35-
}))
36-
})
37-
3830
it('should ls with a base58 encoded CID', async function () {
3931
const content = (name: string): ImportCandidate => ({
4032
path: `test-folder/${name}`,

0 commit comments

Comments
 (0)