Skip to content
This repository was archived by the owner on Feb 12, 2024. It is now read-only.

Commit 244eab1

Browse files
vasco-santosAlan Shaw
authored andcommitted
test: increase name test timeouts (#1756)
1 parent 1a943f8 commit 244eab1

File tree

3 files changed

+30
-20
lines changed

3 files changed

+30
-20
lines changed

test/cli/name.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ describe('name', () => {
7474
})
7575

7676
it('should publish correctly when the file was already added', function () {
77-
this.timeout(60 * 1000)
77+
this.timeout(70 * 1000)
7878

7979
return ipfs(`name publish ${cidAdded}`).then((res) => {
8080
expect(res).to.exist()
@@ -83,7 +83,7 @@ describe('name', () => {
8383
})
8484

8585
it('should publish and resolve an entry with the default options', function () {
86-
this.timeout(60 * 1000)
86+
this.timeout(70 * 1000)
8787

8888
return ipfs(`name publish ${cidAdded}`)
8989
.then((res) => {
@@ -98,7 +98,7 @@ describe('name', () => {
9898
})
9999

100100
it('should publish correctly when the file was not added but resolve is disabled', function () {
101-
this.timeout(60 * 1000)
101+
this.timeout(70 * 1000)
102102

103103
const notAddedCid = 'QmPFVLPmp9zv5Z5KUqLhe2EivAGccQW2r7M7jhVJGLZoZU'
104104

@@ -109,7 +109,7 @@ describe('name', () => {
109109
})
110110

111111
it('should not get the entry correctly if its validity time expired', function () {
112-
this.timeout(60 * 1000)
112+
this.timeout(70 * 1000)
113113

114114
return ipfs(`name publish ${cidAdded} --lifetime 10ns`)
115115
.then((res) => {
@@ -128,7 +128,7 @@ describe('name', () => {
128128
})
129129

130130
it('should publish correctly when a new key is used', function () {
131-
this.timeout(60 * 1000)
131+
this.timeout(70 * 1000)
132132

133133
return ipfs(`name publish ${cidAdded} --key ${name}`).then((res) => {
134134
expect(res).to.exist()
@@ -137,7 +137,7 @@ describe('name', () => {
137137
})
138138

139139
it('should return the immediate pointing record, unless using the recursive parameter', function () {
140-
this.timeout(60 * 1000)
140+
this.timeout(90 * 1000)
141141

142142
return ipfs(`name publish ${cidAdded}`)
143143
.then((res) => {
@@ -159,7 +159,7 @@ describe('name', () => {
159159
})
160160

161161
it('should go recursively until finding an ipfs hash', function () {
162-
this.timeout(60 * 1000)
162+
this.timeout(90 * 1000)
163163

164164
return ipfs(`name publish ${cidAdded}`)
165165
.then((res) => {
@@ -239,7 +239,7 @@ describe('name', () => {
239239
})
240240

241241
it('should publish and resolve an entry with the default options', function () {
242-
this.timeout(60 * 1000)
242+
this.timeout(70 * 1000)
243243

244244
return ipfs(`name publish ${cidAdded}`)
245245
.then((res) => {
@@ -254,7 +254,7 @@ describe('name', () => {
254254
})
255255

256256
it('should not get the entry correctly if its validity time expired', function () {
257-
this.timeout(60 * 1000)
257+
this.timeout(70 * 1000)
258258

259259
return ipfs(`name publish ${cidAdded} --lifetime 10ns`)
260260
.then((res) => {
@@ -273,7 +273,7 @@ describe('name', () => {
273273
})
274274

275275
it('should return the immediate pointing record, unless using the recursive parameter', function () {
276-
this.timeout(60 * 1000)
276+
this.timeout(90 * 1000)
277277

278278
return ipfs(`name publish ${cidAdded}`)
279279
.then((res) => {

test/core/name-pubsub.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ describe('name-pubsub', function () {
6464
after((done) => parallel(nodes.map((node) => (cb) => node.stop(cb)), done))
6565

6666
it('should publish and then resolve correctly', function (done) {
67-
this.timeout(50 * 1000)
67+
this.timeout(80 * 1000)
6868

6969
nodeB.name.resolve(idA.id, (err) => {
7070
expect(err).to.exist()

test/core/name.js

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ describe('name', function () {
4747
let ipfsd
4848

4949
before(function (done) {
50-
this.timeout(40 * 1000)
50+
this.timeout(50 * 1000)
5151
df.spawn({
5252
exec: IPFS,
5353
args: [`--pass ${hat()}`],
@@ -69,10 +69,14 @@ describe('name', function () {
6969
after((done) => ipfsd.stop(done))
7070

7171
it('should publish and then resolve correctly with the default options', function (done) {
72+
this.timeout(50 * 1000)
73+
7274
publishAndResolve(node, node, ipfsRef, { resolve: false }, nodeId, {}, done)
7375
})
7476

7577
it('should publish correctly with the lifetime option and resolve', function (done) {
78+
this.timeout(50 * 1000)
79+
7680
const publishOpts = {
7781
resolve: false,
7882
lifetime: '2h'
@@ -82,6 +86,8 @@ describe('name', function () {
8286
})
8387

8488
it('should not get the entry correctly if its validity time expired', function (done) {
89+
this.timeout(50 * 1000)
90+
8591
node.name.publish(ipfsRef, { resolve: false, lifetime: '1ms' }, (err, res) => {
8692
expect(err).to.not.exist()
8793
expect(res).to.exist()
@@ -96,7 +102,7 @@ describe('name', function () {
96102
})
97103

98104
it('should recursively resolve to an IPFS hash', function (done) {
99-
this.timeout(80 * 1000)
105+
this.timeout(90 * 1000)
100106
const keyName = hat()
101107

102108
node.key.gen(keyName, { type: 'rsa', size: 2048 }, function (err, key) {
@@ -115,7 +121,7 @@ describe('name', function () {
115121
})
116122

117123
it('should not recursively resolve to an IPFS hash if the option recursive is not provided', function (done) {
118-
this.timeout(80 * 1000)
124+
this.timeout(90 * 1000)
119125
const keyName = hat()
120126

121127
node.key.gen(keyName, { type: 'rsa', size: 2048 }, function (err, key) {
@@ -164,7 +170,7 @@ describe('name', function () {
164170
after((done) => ipfsd.stop(done))
165171

166172
it('should republish entries after 60 seconds', function (done) {
167-
this.timeout(100 * 1000)
173+
this.timeout(120 * 1000)
168174
sinon.spy(node._ipns.republisher, '_republishEntries')
169175

170176
setTimeout(function () {
@@ -174,7 +180,7 @@ describe('name', function () {
174180
})
175181

176182
it('should error if run republish again', function (done) {
177-
this.timeout(100 * 1000)
183+
this.timeout(120 * 1000)
178184
sinon.spy(node._ipns.republisher, '_republishEntries')
179185

180186
try {
@@ -203,7 +209,7 @@ describe('name', function () {
203209
}
204210

205211
before(function (done) {
206-
this.timeout(40 * 1000)
212+
this.timeout(70 * 1000)
207213

208214
parallel([
209215
(cb) => createNode(cb),
@@ -232,15 +238,19 @@ describe('name', function () {
232238
})
233239
})
234240

235-
after((done) => parallel(nodes.map((node) => (cb) => node.stop(cb)), done))
241+
after(function (done) {
242+
this.timeout(80 * 1000)
243+
244+
parallel(nodes.map((node) => (cb) => node.stop(cb)), done)
245+
})
236246

237247
it('should publish and then resolve correctly with the default options', function (done) {
238-
this.timeout(50 * 1000)
248+
this.timeout(90 * 1000)
239249
publishAndResolve(nodeA, nodeB, ipfsRef, { resolve: false }, idA.id, {}, done)
240250
})
241251

242252
it('should recursively resolve to an IPFS hash', function (done) {
243-
this.timeout(80 * 1000)
253+
this.timeout(180 * 1000)
244254
const keyName = hat()
245255

246256
nodeA.key.gen(keyName, { type: 'rsa', size: 2048 }, function (err, key) {

0 commit comments

Comments
 (0)