Skip to content

Commit 94a4266

Browse files
committed
Increase the duration in which we allow index cancellation to happen
Slow CI systems weren’t able to resolve the package and prepare the target in 30s. Increase the timeout to 90s to make them pass.
1 parent 9e9579d commit 94a4266

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

Tests/SourceKitLSPTests/BackgroundIndexingTests.swift

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1451,9 +1451,11 @@ final class BackgroundIndexingTests: XCTestCase {
14511451
// Preparation of `Test.swift` should finish instantly because it doesn't type check the function body.
14521452
// Type-checking of `slow()` should be slow because the expression has exponential complexity in the type checker.
14531453
// We should hit the timeout of 1s. Adding another 2s to escalate a SIGINT (to which swift-frontend doesn't respond)
1454-
// to a SIGKILL mean that the initial indexing should be done in ~3s. 30s should be enough to always finish within
1455-
// this time while also testing that we don't wait for type checking of Test.swift to finish.
1456-
XCTAssert(Date().timeIntervalSince(dateStarted) < 30)
1454+
// to a SIGKILL mean that the initial indexing should be done in ~3s. 90s should be enough to always finish within
1455+
// this time while also testing that we don't wait for type checking of Test.swift to finish, even on slow CI
1456+
// systems where package loading might take a while and just calling `swift build` to prepare `Test.swift` also has
1457+
// a delay.
1458+
XCTAssertLessThan(Date().timeIntervalSince(dateStarted), 90)
14571459
}
14581460

14591461
func testRedirectSymlink() async throws {

0 commit comments

Comments
 (0)