Skip to content

Commit 9cd599c

Browse files
committed
Miscellaneous test updates
1 parent ca960bc commit 9cd599c

File tree

2 files changed

+3
-12
lines changed

2 files changed

+3
-12
lines changed

Tests/SourceKitLSPTests/CompilationDatabaseTests.swift

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -75,21 +75,12 @@ final class CompilationDatabaseTests: XCTestCase {
7575
DocumentHighlight(range: positions["5️⃣"]..<positions["6️⃣"], kind: .text),
7676
]
7777

78-
var didReceiveCorrectHighlight = false
79-
8078
// Updating the build settings takes a few seconds.
8179
// Send highlight requests every second until we receive correct results.
82-
for _ in 0..<30 {
80+
try await repeatUntilExpectedResult {
8381
let postChangeHighlightResponse = try await project.testClient.send(highlightRequest)
84-
85-
if postChangeHighlightResponse == expectedPostEditHighlight {
86-
didReceiveCorrectHighlight = true
87-
break
88-
}
89-
try await Task.sleep(for: .seconds(1))
82+
return postChangeHighlightResponse == expectedPostEditHighlight
9083
}
91-
92-
XCTAssert(didReceiveCorrectHighlight)
9384
}
9485

9586
func testJSONCompilationDatabaseWithDifferentToolchainsForSwift() async throws {

Tests/SourceKitLSPTests/WorkspaceTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1205,7 +1205,7 @@ final class WorkspaceTests: XCTestCase {
12051205
swiftPMTestHooks: SwiftPMTestHooks(
12061206
reloadPackageDidStart: {
12071207
// Essentially make sure that the package never loads, so we are forced to return fallback arguments.
1208-
try? await Task.sleep(for: .seconds(60 * 60))
1208+
try? await Task.sleep(for: .seconds(defaultTimeout * 2))
12091209
}
12101210
)
12111211
)

0 commit comments

Comments
 (0)