Skip to content

Commit 3e7f350

Browse files
authored
Merge pull request #2008 from ahoppen/testimplicitcancellation
Make `testImplicitCancellationOnEdit` more robust
2 parents 85e0f96 + 9ceedcd commit 3e7f350

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Tests/SourceKitLSPTests/SemanticTokensTests.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -897,8 +897,9 @@ final class SemanticTokensTests: XCTestCase {
897897
let testClient = try await TestSourceKitLSPClient(
898898
hooks: Hooks(preHandleRequest: { request in
899899
if request is DocumentSemanticTokensRequest {
900-
// Sleep long enough for the edit to be handled
901-
try? await Task.sleep(for: .seconds(10))
900+
while !Task.isCancelled {
901+
try? await Task.sleep(for: .seconds(1))
902+
}
902903
}
903904
})
904905
)

0 commit comments

Comments
 (0)