Skip to content

Commit 34bbe42

Browse files
committed
Increase test timeouts to 5 seconds
1 parent fe5d1b5 commit 34bbe42

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

Tests/MQTTNIOTests/MQTTNIOTests.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ final class MQTTNIOTests: XCTestCase {
130130
expectation.fulfill()
131131
}
132132

133-
wait(for: [expectation], timeout: 1.0)
133+
wait(for: [expectation], timeout: 5.0)
134134

135135
XCTAssertFalse(client.isActive())
136136
try client.syncShutdownGracefully()
@@ -159,7 +159,7 @@ final class MQTTNIOTests: XCTestCase {
159159
try client.publish(to: "testMQTTPublishRetain", payload: payload, qos: .atLeastOnce, retain: true).wait()
160160
_ = try client.subscribe(to: [.init(topicFilter: "testMQTTPublishRetain", qos: .atLeastOnce)]).wait()
161161

162-
wait(for: [expectation], timeout: 2.0)
162+
wait(for: [expectation], timeout: 5.0)
163163

164164
try client.disconnect().wait()
165165
try client.syncShutdownGracefully()
@@ -193,7 +193,7 @@ final class MQTTNIOTests: XCTestCase {
193193
try client.publish(to: "testAtLeastOnce", payload: payload, qos: .atLeastOnce).wait()
194194
try client.publish(to: "testExactlyOnce", payload: payload, qos: .exactlyOnce).wait()
195195

196-
wait(for: [expectation], timeout: 2.0)
196+
wait(for: [expectation], timeout: 5.0)
197197

198198
try client.disconnect().wait()
199199
try client2.disconnect().wait()
@@ -230,7 +230,7 @@ final class MQTTNIOTests: XCTestCase {
230230
try client2.unsubscribe(from: ["testUnsubscribe"]).wait()
231231
try client.publish(to: "testUnsubscribe", payload: payload, qos: .atLeastOnce).wait()
232232

233-
wait(for: [expectation], timeout: 2.0)
233+
wait(for: [expectation], timeout: 5.0)
234234

235235
try client.disconnect().wait()
236236
try client2.disconnect().wait()
@@ -265,7 +265,7 @@ final class MQTTNIOTests: XCTestCase {
265265
_ = try client2.subscribe(to: [.init(topicFilter: "testLargeAtLeastOnce", qos: .atLeastOnce)]).wait()
266266
try client.publish(to: "testLargeAtLeastOnce", payload: payload, qos: .atLeastOnce).wait()
267267

268-
wait(for: [expectation], timeout: 2.0)
268+
wait(for: [expectation], timeout: 5.0)
269269

270270
try client.disconnect().wait()
271271
try client2.disconnect().wait()
@@ -361,7 +361,7 @@ final class MQTTNIOTests: XCTestCase {
361361
// should not receive previous publish on connect as this is a cleanSession
362362
_ = try client2.connect(cleanSession: true).wait()
363363

364-
wait(for: [expectation], timeout: 2.0)
364+
wait(for: [expectation], timeout: 5.0)
365365

366366
try client.disconnect().wait()
367367
try client2.disconnect().wait()

Tests/MQTTNIOTests/MQTTNIOv5Tests.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ final class MQTTNIOv5Tests: XCTestCase {
140140

141141
try client.publish(to: "testMQTTSubscribeFlags1", payload: payload, qos: .atLeastOnce, retain: false).wait()
142142

143-
wait(for: [expectation], timeout: 2)
143+
wait(for: [expectation], timeout: 5)
144144

145145
try client.disconnect().wait()
146146
try client.syncShutdownGracefully()
@@ -181,7 +181,7 @@ final class MQTTNIOv5Tests: XCTestCase {
181181
properties: [.contentType("application/json")]
182182
).wait()
183183

184-
wait(for: [expectation], timeout: 2.0)
184+
wait(for: [expectation], timeout: 5.0)
185185

186186
try client.disconnect().wait()
187187
try client.syncShutdownGracefully()
@@ -218,7 +218,7 @@ final class MQTTNIOv5Tests: XCTestCase {
218218
XCTAssertEqual(unsub.reasons[1], .noSubscriptionExisted)
219219
try client.publish(to: "testUnsubscribe", payload: payload, qos: .atLeastOnce).wait()
220220

221-
wait(for: [expectation], timeout: 2.0)
221+
wait(for: [expectation], timeout: 5.0)
222222

223223
try client.disconnect().wait()
224224
try client2.disconnect().wait()
@@ -275,7 +275,7 @@ final class MQTTNIOv5Tests: XCTestCase {
275275
// should not receive previous publish on connect as this is a cleanSession
276276
_ = try client2.v5.connect(cleanStart: true).wait()
277277

278-
wait(for: [expectation], timeout: 2.0)
278+
wait(for: [expectation], timeout: 5.0)
279279

280280
try client.disconnect().wait()
281281
try client2.disconnect().wait()

0 commit comments

Comments
 (0)