Skip to content

Commit 64e0e04

Browse files
committed
Improve timeout limit in test
1 parent 3844ab8 commit 64e0e04

15 files changed

+326
-149
lines changed

Tests/MeiliSearchIntegrationTests/DocumentsTests.swift

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ class DocumentsTests: XCTestCase {
5656
expectation.fulfill()
5757
}
5858
}
59-
self.wait(for: [expectation], timeout: 10.0)
59+
self.wait(for: [expectation], timeout: 20.0)
6060
}
6161

6262
func testAddDocuments() {
@@ -106,7 +106,7 @@ class DocumentsTests: XCTestCase {
106106
expectation.fulfill()
107107
}
108108
}
109-
self.wait(for: [expectation], timeout: 5.0)
109+
self.wait(for: [expectation], timeout: 20.0)
110110
}
111111

112112
func testAddDocumentsWithNoPrimaryKey() {
@@ -136,7 +136,7 @@ class DocumentsTests: XCTestCase {
136136
}
137137

138138
}
139-
self.wait(for: [expectation], timeout: 5.0)
139+
self.wait(for: [expectation], timeout: 20.0)
140140
}
141141

142142
func testGetDocumentsWithParameters() {
@@ -180,7 +180,7 @@ class DocumentsTests: XCTestCase {
180180
expectation.fulfill()
181181
}
182182
}
183-
self.wait(for: [expectation], timeout: 5.0)
183+
self.wait(for: [expectation], timeout: 20.0)
184184
}
185185

186186
func testGetOneDocumentAndFail() {
@@ -238,7 +238,7 @@ class DocumentsTests: XCTestCase {
238238
}
239239
}
240240

241-
self.wait(for: [expectation], timeout: 5.0)
241+
self.wait(for: [expectation], timeout: 20.0)
242242
}
243243

244244
func testAddAndGetOneDocument() {
@@ -281,7 +281,7 @@ class DocumentsTests: XCTestCase {
281281
}
282282
}
283283

284-
self.wait(for: [expectation], timeout: 5.0)
284+
self.wait(for: [expectation], timeout: 20.0)
285285
}
286286

287287
func testUpdateDocument() {
@@ -315,7 +315,7 @@ class DocumentsTests: XCTestCase {
315315
}
316316
}
317317

318-
self.wait(for: [expectation], timeout: 5.0)
318+
self.wait(for: [expectation], timeout: 20.0)
319319
}
320320

321321
func testDeleteOneDocument() {
@@ -334,7 +334,7 @@ class DocumentsTests: XCTestCase {
334334
expectation.fulfill()
335335
}
336336
}
337-
self.wait(for: [expectation], timeout: 5.0)
337+
self.wait(for: [expectation], timeout: 20.0)
338338

339339
let deleteExpectation = XCTestExpectation(description: "Delete one Movie")
340340
self.index.deleteDocument("42") { (result: Result<Task, Swift.Error>) in
@@ -376,7 +376,7 @@ class DocumentsTests: XCTestCase {
376376
expectation.fulfill()
377377
}
378378
}
379-
self.wait(for: [expectation], timeout: 10.0)
379+
self.wait(for: [expectation], timeout: 20.0)
380380

381381
let deleteExpectation = XCTestExpectation(description: "Delete all documents")
382382
self.index.deleteAllDocuments { (result: Result<Task, Swift.Error>) in
@@ -409,7 +409,7 @@ class DocumentsTests: XCTestCase {
409409
}
410410
}
411411

412-
self.wait(for: [deleteExpectation], timeout: 10.0)
412+
self.wait(for: [deleteExpectation], timeout: 20.0)
413413
}
414414

415415
func testDeleteBatchDocuments() {
@@ -428,7 +428,7 @@ class DocumentsTests: XCTestCase {
428428
expectation.fulfill()
429429
}
430430
}
431-
self.wait(for: [expectation], timeout: 10.0)
431+
self.wait(for: [expectation], timeout: 20.0)
432432

433433
let deleteExpectation = XCTestExpectation(description: "Delete batch movies")
434434
let idsToDelete: [Int] = [2, 1, 4]
@@ -453,7 +453,7 @@ class DocumentsTests: XCTestCase {
453453
deleteExpectation.fulfill()
454454
}
455455
}
456-
self.wait(for: [deleteExpectation], timeout: 5.0)
456+
self.wait(for: [deleteExpectation], timeout: 20.0)
457457
}
458458
}
459459
// swiftlint:enable force_unwrapping

Tests/MeiliSearchIntegrationTests/DumpsTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class DumpsTests: XCTestCase {
4141
}
4242
}
4343

44-
self.wait(for: [expectation], timeout: 10.0)
44+
self.wait(for: [expectation], timeout: 20.0)
4545
}
4646
}
4747
// swiftlint:enable force_try

Tests/MeiliSearchIntegrationTests/IndexesTests.swift

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class IndexesTests: XCTestCase {
4141
getIndexesExp.fulfill()
4242
}
4343
}
44-
self.wait(for: [getIndexesExp], timeout: 5.0)
44+
self.wait(for: [getIndexesExp], timeout: 20.0)
4545
}
4646

4747
func testCreateIndex() {
@@ -68,7 +68,7 @@ class IndexesTests: XCTestCase {
6868
createExpectation.fulfill()
6969
}
7070
}
71-
self.wait(for: [createExpectation], timeout: 5.0)
71+
self.wait(for: [createExpectation], timeout: 20.0)
7272
}
7373

7474
func testCreateIndexThatAlreadyExists() {
@@ -83,7 +83,7 @@ class IndexesTests: XCTestCase {
8383
deleteException.fulfill()
8484
}
8585
}
86-
self.wait(for: [deleteException], timeout: 5.0)
86+
self.wait(for: [deleteException], timeout: 20.0)
8787

8888
let createExpectation = XCTestExpectation(description: "Create Movies index")
8989
createGenericIndex(client: self.client, uid: self.uid ) { result in
@@ -98,7 +98,7 @@ class IndexesTests: XCTestCase {
9898
createExpectation.fulfill()
9999
}
100100
}
101-
self.wait(for: [createExpectation], timeout: 5.0)
101+
self.wait(for: [createExpectation], timeout: 20.0)
102102

103103
let create2ndIndexExpectation = XCTestExpectation(description: "Create Movies index that already exists and fail")
104104
self.client.createIndex(uid: self.uid) { result in
@@ -127,7 +127,7 @@ class IndexesTests: XCTestCase {
127127
create2ndIndexExpectation.fulfill()
128128
}
129129
}
130-
self.wait(for: [create2ndIndexExpectation], timeout: 5.0)
130+
self.wait(for: [create2ndIndexExpectation], timeout: 20.0)
131131

132132
}
133133

@@ -144,7 +144,7 @@ class IndexesTests: XCTestCase {
144144
createExpectation.fulfill()
145145
}
146146
}
147-
self.wait(for: [createExpectation], timeout: 5.0)
147+
self.wait(for: [createExpectation], timeout: 20.0)
148148

149149
let getIndexExpectation = XCTestExpectation(description: "Get index")
150150

@@ -160,7 +160,7 @@ class IndexesTests: XCTestCase {
160160
}
161161
}
162162

163-
self.wait(for: [getIndexExpectation], timeout: 5.0)
163+
self.wait(for: [getIndexExpectation], timeout: 20.0)
164164
}
165165

166166
func testGetIndexes() {
@@ -175,7 +175,7 @@ class IndexesTests: XCTestCase {
175175
createExpectation.fulfill()
176176
}
177177
}
178-
self.wait(for: [createExpectation], timeout: 5.0)
178+
self.wait(for: [createExpectation], timeout: 20.0)
179179

180180
let expectation = XCTestExpectation(description: "Load indexes")
181181

@@ -190,7 +190,7 @@ class IndexesTests: XCTestCase {
190190
}
191191
}
192192

193-
self.wait(for: [expectation], timeout: 5.0)
193+
self.wait(for: [expectation], timeout: 20.0)
194194
}
195195

196196
func testUpdateIndexName() {
@@ -205,7 +205,7 @@ class IndexesTests: XCTestCase {
205205
createExpectation.fulfill()
206206
}
207207
}
208-
self.wait(for: [createExpectation], timeout: 5.0)
208+
self.wait(for: [createExpectation], timeout: 20.0)
209209

210210
// This tests should tests primary key when they are added to this function
211211
let updateExpectation = XCTestExpectation(description: "Update movie index")
@@ -239,7 +239,7 @@ class IndexesTests: XCTestCase {
239239
updateExpectation.fulfill()
240240
}
241241
}
242-
self.wait(for: [updateExpectation], timeout: 5.0)
242+
self.wait(for: [updateExpectation], timeout: 20.0)
243243
}
244244

245245
func testDeleteIndex() {
@@ -255,7 +255,7 @@ class IndexesTests: XCTestCase {
255255
createExpectation.fulfill()
256256
}
257257
}
258-
self.wait(for: [createExpectation], timeout: 5.0)
258+
self.wait(for: [createExpectation], timeout: 20.0)
259259

260260
let deleteException = XCTestExpectation(description: "Delete Movies index")
261261
deleteIndex(client: self.client, uid: self.uid) { result in
@@ -270,7 +270,7 @@ class IndexesTests: XCTestCase {
270270
deleteException.fulfill()
271271
}
272272
}
273-
self.wait(for: [deleteException], timeout: 5.0)
273+
self.wait(for: [deleteException], timeout: 20.0)
274274
}
275275

276276
// TODO: remove
@@ -289,7 +289,7 @@ class IndexesTests: XCTestCase {
289289
// }
290290
// }
291291

292-
// self.wait(for: [expectation], timeout: 5.0)
292+
// self.wait(for: [expectation], timeout: 20.0)
293293
// }
294294

295295
// func testGetOrCreateIndexAlreadyExists() {
@@ -306,7 +306,7 @@ class IndexesTests: XCTestCase {
306306
// }
307307
// }
308308

309-
// self.wait(for: [expectation], timeout: 5.0)
309+
// self.wait(for: [expectation], timeout: 20.0)
310310

311311
// sleep(2)
312312

@@ -323,7 +323,7 @@ class IndexesTests: XCTestCase {
323323
// }
324324
// }
325325

326-
// self.wait(for: [secondExpectation], timeout: 5.0)
326+
// self.wait(for: [secondExpectation], timeout: 20.0)
327327
// }
328328

329329
}

0 commit comments

Comments
 (0)