Skip to content

Commit 87dd406

Browse files
authored
Merge pull request #2077 from ahoppen/shutdown-semaphore
Add a timeout to the semaphore we use for shutting down SourceKit-LSP
2 parents 684bfe4 + 6feab14 commit 87dd406

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Sources/SKTestSupport/TestSourceKitLSPClient.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,11 +216,11 @@ package final class TestSourceKitLSPClient: MessageHandler, Sendable {
216216
deinit {
217217
// It's really unfortunate that there are no async deinits. If we had async
218218
// deinits, we could await the sending of a ShutdownRequest.
219-
let sema = DispatchSemaphore(value: 0)
219+
let sema = WrappedSemaphore(name: "Shutdown")
220220
server.handle(ShutdownRequest(), id: .number(Int(nextRequestID.fetchAndIncrement()))) { result in
221221
sema.signal()
222222
}
223-
sema.wait()
223+
sema.waitOrXCTFail()
224224
self.send(ExitNotification())
225225

226226
cleanUp()

0 commit comments

Comments
 (0)