Skip to content

Commit 7a1324d

Browse files
authored
Merge pull request #1362 from ahoppen/test-memory-leak
2 parents 0f86e01 + 1b914a7 commit 7a1324d

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

Tests/SourceKitLSPTests/BackgroundIndexingTests.swift

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -604,13 +604,14 @@ final class BackgroundIndexingTests: XCTestCase {
604604
)
605605

606606
let receivedEmptyDiagnostics = self.expectation(description: "Received diagnostic refresh request")
607+
receivedEmptyDiagnostics.assertForOverFulfill = false
607608
project.testClient.handleMultipleRequests { (_: CreateWorkDoneProgressRequest) in
608609
return VoidResponse()
609610
}
610611

611-
project.testClient.handleMultipleRequests { (_: DiagnosticsRefreshRequest) in
612-
Task {
613-
let updatedDiagnostics = try await project.testClient.send(
612+
project.testClient.handleMultipleRequests { [weak project] (_: DiagnosticsRefreshRequest) in
613+
Task { [weak project] in
614+
let updatedDiagnostics = try await project?.testClient.send(
614615
DocumentDiagnosticsRequest(textDocument: TextDocumentIdentifier(uri))
615616
)
616617
guard case .full(let updatedDiagnostics) = updatedDiagnostics else {

0 commit comments

Comments
 (0)