Skip to content

Commit 2db1a9d

Browse files
Merge pull request #18595 from wordpress-mobile/fix/xctest-wait-flakiness
Enhance the stability of flaky unit tests
2 parents c16a40a + ca9bfbb commit 2db1a9d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

WordPress/WordPressTest/Extensions/XCTestCase+Wait.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ extension XCTestCase {
77
waitExpectation.fulfill()
88
}
99

10-
waitForExpectations(timeout: duration)
10+
// We wait for the duration + 1 second to allow some buffer in case the dispatched block gets
11+
// delayed by GCD for any reason for even 1 microsecond.
12+
waitForExpectations(timeout: duration + 1)
1113
}
1214
}

0 commit comments

Comments
 (0)