Skip to content

Commit c045182

Browse files
committed
Fix issue that caused request cancellation after a timeout in tests to not work
We were calling `server.handle(notification:)`, which called directly into `SourceKitLSPServer` but request handling is implemented in `QueueBasedMessageHandler.handle(_:)`. Call that to ensure that we actually cancel requests after the test timeout.
1 parent 67a16e6 commit c045182

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Sources/SKTestSupport/TestSourceKitLSPClient.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ package final class TestSourceKitLSPClient: MessageHandler, Sendable {
261261
.failure(ResponseError.unknown("\(R.method) request timed out after \(defaultTimeoutDuration)"))
262262
)
263263
}
264-
await server.handle(notification: CancelRequestNotification(id: requestID))
264+
server.handle(CancelRequestNotification(id: requestID))
265265
}
266266
server.handle(request, id: requestID) { result in
267267
if replyOutstanding.takeValue() ?? false {

0 commit comments

Comments
 (0)