Skip to content
This repository was archived by the owner on Sep 15, 2025. It is now read-only.

Commit bce8664

Browse files
committed
Slightly increase expectation timeout from 0.1s to 0.3s
1 parent a398d95 commit bce8664

9 files changed

+49
-49
lines changed

WordPressKitTests/ActivityServiceRemoteTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -435,6 +435,6 @@ class ActivityServiceRemoteTests: RemoteTestCase, RESTTestable {
435435
XCTFail("The success block should be called")
436436
}
437437

438-
wait(for: [expect], timeout: 0.1)
438+
wait(for: [expect], timeout: 0.3)
439439
}
440440
}

WordPressKitTests/BlockEditorSettingsServiceRemoteTests.swift

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ extension BlockEditorSettingsServiceRemoteTests {
5050
waitExpectation.fulfill()
5151
}
5252

53-
wait(for: [waitExpectation], timeout: 0.1)
53+
wait(for: [waitExpectation], timeout: 0.3)
5454
}
5555

5656
func testFetchThemeNoGradients() {
@@ -81,7 +81,7 @@ extension BlockEditorSettingsServiceRemoteTests {
8181
waitExpectation.fulfill()
8282
}
8383

84-
wait(for: [waitExpectation], timeout: 0.1)
84+
wait(for: [waitExpectation], timeout: 0.3)
8585
}
8686

8787
func testFetchThemeNoColors() {
@@ -117,7 +117,7 @@ extension BlockEditorSettingsServiceRemoteTests {
117117
waitExpectation.fulfill()
118118
}
119119

120-
wait(for: [waitExpectation], timeout: 0.1)
120+
wait(for: [waitExpectation], timeout: 0.3)
121121
}
122122

123123
func testFetchThemeNoThemeSupport() {
@@ -144,7 +144,7 @@ extension BlockEditorSettingsServiceRemoteTests {
144144
waitExpectation.fulfill()
145145
}
146146

147-
wait(for: [waitExpectation], timeout: 0.1)
147+
wait(for: [waitExpectation], timeout: 0.3)
148148
}
149149

150150
func testFetchThemeFailure() {
@@ -163,7 +163,7 @@ extension BlockEditorSettingsServiceRemoteTests {
163163
waitExpectation.fulfill()
164164
}
165165

166-
wait(for: [waitExpectation], timeout: 0.1)
166+
wait(for: [waitExpectation], timeout: 0.3)
167167
}
168168

169169
}
@@ -189,7 +189,7 @@ extension BlockEditorSettingsServiceRemoteTests {
189189
waitExpectation.fulfill()
190190
}
191191

192-
wait(for: [waitExpectation], timeout: 0.1)
192+
wait(for: [waitExpectation], timeout: 0.3)
193193
}
194194

195195
func testFetchBlockEditorSettingsThemeJSON() {
@@ -214,7 +214,7 @@ extension BlockEditorSettingsServiceRemoteTests {
214214
waitExpectation.fulfill()
215215
}
216216

217-
wait(for: [waitExpectation], timeout: 0.1)
217+
wait(for: [waitExpectation], timeout: 0.3)
218218
}
219219

220220
func testFetchBlockEditorSettingsNoFSETheme() {
@@ -238,7 +238,7 @@ extension BlockEditorSettingsServiceRemoteTests {
238238
waitExpectation.fulfill()
239239
}
240240

241-
wait(for: [waitExpectation], timeout: 0.1)
241+
wait(for: [waitExpectation], timeout: 0.3)
242242
}
243243

244244
func testFetchBlockEditorSettingsThemeJSON_ConsistentChecksum() {
@@ -266,7 +266,7 @@ extension BlockEditorSettingsServiceRemoteTests {
266266
waitExpectation.fulfill()
267267
}
268268

269-
wait(for: [waitExpectation], timeout: 0.1)
269+
wait(for: [waitExpectation], timeout: 0.3)
270270
}
271271

272272
func testFetchBlockEditorSettingsOrgEndpoint() {
@@ -280,7 +280,7 @@ extension BlockEditorSettingsServiceRemoteTests {
280280
waitExpectation.fulfill()
281281
}
282282

283-
wait(for: [waitExpectation], timeout: 0.1)
283+
wait(for: [waitExpectation], timeout: 0.3)
284284
}
285285

286286
// The only difference between this test and the one above (testFetchBlockEditorSettingsOrgEndpoint) is this
@@ -300,7 +300,7 @@ extension BlockEditorSettingsServiceRemoteTests {
300300
waitExpectation.fulfill()
301301
}
302302

303-
wait(for: [waitExpectation], timeout: 0.1)
303+
wait(for: [waitExpectation], timeout: 0.3)
304304
}
305305

306306
private func validateFetchBlockEditorSettingsResults(_ result: RemoteBlockEditorSettings?) {

WordPressKitTests/EditorServiceRemoteTests.swift

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class EditorServiceRemoteTests: XCTestCase {
3333
}
3434
mockRemoteApi.successBlockPassedIn?(response as AnyObject, HTTPURLResponse())
3535

36-
wait(for: [expec], timeout: 0.1)
36+
wait(for: [expec], timeout: 0.3)
3737
}
3838

3939
func testPostDesignateMobileEditorSuccessSettingAztec() {
@@ -50,7 +50,7 @@ class EditorServiceRemoteTests: XCTestCase {
5050
}
5151
mockRemoteApi.successBlockPassedIn?(response as AnyObject, HTTPURLResponse())
5252

53-
wait(for: [expec], timeout: 0.1)
53+
wait(for: [expec], timeout: 0.3)
5454
}
5555

5656
func testPostDesignateMobileEditorDoesNotCrashWithBadKeyResponse() {
@@ -70,7 +70,7 @@ class EditorServiceRemoteTests: XCTestCase {
7070
}
7171
mockRemoteApi.successBlockPassedIn?(response as AnyObject, HTTPURLResponse())
7272

73-
wait(for: [expec], timeout: 0.1)
73+
wait(for: [expec], timeout: 0.3)
7474
}
7575

7676
func testPostDesignateMobileEditorThrowsErrorWithBadValueResponse() {
@@ -88,7 +88,7 @@ class EditorServiceRemoteTests: XCTestCase {
8888
}
8989
mockRemoteApi.successBlockPassedIn?(response as AnyObject, HTTPURLResponse())
9090

91-
wait(for: [expec], timeout: 0.1)
91+
wait(for: [expec], timeout: 0.3)
9292
}
9393

9494
func testPostDesignateMobileEditorError() {
@@ -104,7 +104,7 @@ class EditorServiceRemoteTests: XCTestCase {
104104
mockRemoteApi.failureBlockPassedIn?(errorExpec, nil)
105105
XCTAssertTrue(mockRemoteApi.postMethodCalled)
106106

107-
wait(for: [expec], timeout: 0.1)
107+
wait(for: [expec], timeout: 0.3)
108108
}
109109

110110
// MARK: - GET tests
@@ -124,7 +124,7 @@ class EditorServiceRemoteTests: XCTestCase {
124124
mockRemoteApi.successBlockPassedIn?(response as AnyObject, HTTPURLResponse())
125125
XCTAssertTrue(mockRemoteApi.getMethodCalled)
126126

127-
wait(for: [expec], timeout: 0.1)
127+
wait(for: [expec], timeout: 0.3)
128128
}
129129

130130
func testGetEditorSettingsNotSetForMobile() {
@@ -142,7 +142,7 @@ class EditorServiceRemoteTests: XCTestCase {
142142
mockRemoteApi.successBlockPassedIn?(response as AnyObject, HTTPURLResponse())
143143
XCTAssertTrue(mockRemoteApi.getMethodCalled)
144144

145-
wait(for: [expec], timeout: 0.1)
145+
wait(for: [expec], timeout: 0.3)
146146
}
147147

148148
func testGetEditorSettingsClassic() {
@@ -160,7 +160,7 @@ class EditorServiceRemoteTests: XCTestCase {
160160
mockRemoteApi.successBlockPassedIn?(response as AnyObject, HTTPURLResponse())
161161
XCTAssertTrue(mockRemoteApi.getMethodCalled)
162162

163-
wait(for: [expec], timeout: 0.1)
163+
wait(for: [expec], timeout: 0.3)
164164
}
165165

166166
func testGetEditorSettingsFailure() {
@@ -177,7 +177,7 @@ class EditorServiceRemoteTests: XCTestCase {
177177
mockRemoteApi.failureBlockPassedIn?(errorExpec, nil)
178178
XCTAssertTrue(mockRemoteApi.getMethodCalled)
179179

180-
wait(for: [expec], timeout: 0.1)
180+
wait(for: [expec], timeout: 0.3)
181181
}
182182

183183
func testPostDesignateGutenbergMobileEditorForAllSites() {
@@ -205,7 +205,7 @@ class EditorServiceRemoteTests: XCTestCase {
205205
mockRemoteApi.successBlockPassedIn?(response as AnyObject, HTTPURLResponse())
206206
XCTAssertTrue(mockRemoteApi.postMethodCalled)
207207

208-
wait(for: [expec], timeout: 0.1)
208+
wait(for: [expec], timeout: 0.3)
209209
}
210210

211211
func testPostDesignateAztecMobileEditorForAllSites() {
@@ -233,7 +233,7 @@ class EditorServiceRemoteTests: XCTestCase {
233233
mockRemoteApi.successBlockPassedIn?(response as AnyObject, HTTPURLResponse())
234234
XCTAssertTrue(mockRemoteApi.postMethodCalled)
235235

236-
wait(for: [expec], timeout: 0.1)
236+
wait(for: [expec], timeout: 0.3)
237237
}
238238
}
239239

WordPressKitTests/Utilities/URLSessionHelperTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ class URLSessionHelperTests: XCTestCase {
135135
}
136136

137137
let _ = await URLSession.shared.perform(request: .init(url: URL(string: "https://wordpress.org/hello")!), fulfilling: progress, errorType: TestError.self)
138-
await fulfillment(of: [progressReported], timeout: 0.1)
138+
await fulfillment(of: [progressReported], timeout: 0.3)
139139
observer.invalidate()
140140
}
141141

WordPressKitTests/WordPressAPI/CookieNonceAuthenticatorTests.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ final class CookieNonceAuthenticatorTests: XCTestCase {
3939
let session = SessionManager(configuration: .ephemeral)
4040
session.adapter = authenticator
4141
session.retrier = authenticator
42-
wait(for: [apiCallShouldSucceed(using: session)], timeout: 0.1)
42+
wait(for: [apiCallShouldSucceed(using: session)], timeout: 0.3)
4343
}
4444

4545
func testUsingRESTNonceAjax() {
@@ -50,7 +50,7 @@ final class CookieNonceAuthenticatorTests: XCTestCase {
5050
let session = SessionManager(configuration: .ephemeral)
5151
session.adapter = authenticator
5252
session.retrier = authenticator
53-
wait(for: [apiCallShouldSucceed(using: session)], timeout: 0.1)
53+
wait(for: [apiCallShouldSucceed(using: session)], timeout: 0.3)
5454
}
5555

5656
private func stubLoginRedirect(dest: URL) {

WordPressKitTests/WordPressAPI/WordPressOrgXMLRPCValidatorTests.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ final class WordPressOrgXMLRPCValidatorTests: XCTestCase {
119119
XCTAssertTrue(validatorError == .invalid || validatorError == .notWordPressError, "Got an error: \(error)")
120120
failure.fulfill()
121121
}
122-
wait(for: [failure], timeout: 0.1)
122+
wait(for: [failure], timeout: 0.3)
123123
}
124124

125125
func testSuccessWithSiteAddress() {
@@ -141,7 +141,7 @@ final class WordPressOrgXMLRPCValidatorTests: XCTestCase {
141141
}) {
142142
XCTFail("Unexpected result: \($0)")
143143
}
144-
wait(for: [success], timeout: 0.1)
144+
wait(for: [success], timeout: 0.3)
145145
}
146146

147147
func testSuccessWithIrregularXMLRPCAddress() {

WordPressKitTests/WordPressComRestApiTests.swift

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ class WordPressComRestApiTests: XCTestCase {
7373

7474
let api = WordPressComRestApi(oAuthToken: "fakeToken")
7575
_ = await api.perform(method, URLString: "test")
76-
await fulfillment(of: [requestReceived], timeout: 0.1)
76+
await fulfillment(of: [requestReceived], timeout: 0.3)
7777

7878
XCTAssertEqual(request?.httpMethod?.uppercased(), method.rawValue.uppercased())
7979
}
@@ -95,7 +95,7 @@ class WordPressComRestApiTests: XCTestCase {
9595
success: { _, _ in expect.fulfill() },
9696
failure: { (_, _) in expect.fulfill() }
9797
)
98-
wait(for: [expect], timeout: 0.1)
98+
wait(for: [expect], timeout: 0.3)
9999

100100
let query = requestURL?
101101
.query(percentEncoded: false)?
@@ -152,7 +152,7 @@ class WordPressComRestApiTests: XCTestCase {
152152

153153
let api = WordPressComRestApi(oAuthToken: "fakeToken")
154154
_ = await api.perform(.get, URLString: "test?arg=value")
155-
await fulfillment(of: [requestReceived], timeout: 0.1)
155+
await fulfillment(of: [requestReceived], timeout: 0.3)
156156

157157
XCTAssertEqual(request?.url?.path, "/test")
158158
XCTAssertTrue(request?.url?.query?.contains("arg=value") == true)
@@ -417,7 +417,7 @@ class WordPressComRestApiTests: XCTestCase {
417417
}
418418
)
419419

420-
wait(for: [complete], timeout: 0.1)
420+
wait(for: [complete], timeout: 0.3)
421421
}
422422

423423
func testStatusCode502() {
@@ -440,7 +440,7 @@ class WordPressComRestApiTests: XCTestCase {
440440
}
441441
)
442442

443-
wait(for: [complete], timeout: 0.1)
443+
wait(for: [complete], timeout: 0.3)
444444
}
445445

446446
func testTooManyRequestError() {
@@ -467,7 +467,7 @@ class WordPressComRestApiTests: XCTestCase {
467467
}
468468
)
469469

470-
wait(for: [complete], timeout: 0.1)
470+
wait(for: [complete], timeout: 0.3)
471471
}
472472

473473
func testPreconditionFailureError() {
@@ -491,7 +491,7 @@ class WordPressComRestApiTests: XCTestCase {
491491
}
492492
)
493493

494-
wait(for: [complete], timeout: 0.1)
494+
wait(for: [complete], timeout: 0.3)
495495
}
496496

497497
/// Verify that parameters in POST requests are sent as JSON.
@@ -516,7 +516,7 @@ class WordPressComRestApiTests: XCTestCase {
516516
}
517517
)
518518

519-
wait(for: [complete], timeout: 0.1)
519+
wait(for: [complete], timeout: 0.3)
520520

521521
let request = try XCTUnwrap(req)
522522
XCTAssertEqual(request.httpMethod?.uppercased(), "POST")

WordPressKitTests/WordPressOrgRestApiTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ class WordPressOrgRestApiTests: XCTestCase {
108108
complete.fulfill()
109109
}
110110

111-
wait(for: [complete], timeout: 0.1)
111+
wait(for: [complete], timeout: 0.3)
112112

113113
let request = try XCTUnwrap(req)
114114
XCTAssertEqual(request.httpMethod?.uppercased(), "POST")

0 commit comments

Comments
 (0)