Skip to content

Commit

Permalink
Formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
gjcairo committed Nov 21, 2023
1 parent eb3a151 commit 1e3ccb6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
4 changes: 2 additions & 2 deletions Sources/GRPCCore/Transport/InProcessClientTransport.swift
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ public struct InProcessClientTransport: ClientTransport {
inbound: request.stream,
outbound: response.writer
)

let waitForConnectionStream: AsyncStream<Void>? = self.state.withLockedValue { state in
if case .unconnected(var unconnectedState) = state {
let (stream, continuation) = AsyncStream<Void>.makeStream()
Expand All @@ -246,7 +246,7 @@ public struct InProcessClientTransport: ClientTransport {
}
return nil
}

if let waitForConnectionStream {
for await _ in waitForConnectionStream {
// This loop will exit either when the task is cancelled or when the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import XCTest

final class InProcessClientTransportTests: XCTestCase {
struct FailTest: Error {}

func testConnectWhenConnected() async {
let client = makeClient()

Expand Down Expand Up @@ -78,14 +78,14 @@ final class InProcessClientTransportTests: XCTestCase {

func testCloseWhenUnconnected() {
let client = makeClient()

XCTAssertNoThrow(client.close())
}

func testCloseWhenClosed() {
let client = makeClient()
client.close()

XCTAssertNoThrow(client.close())
}

Expand Down Expand Up @@ -155,7 +155,7 @@ final class InProcessClientTransportTests: XCTestCase {
try await stream.outbound.write(.message([1]))
stream.outbound.finish()
let receivedMessages = try await stream.inbound.collect()

XCTAssertEqual(receivedMessages, [.message([42])])
}
}
Expand Down Expand Up @@ -210,7 +210,7 @@ final class InProcessClientTransportTests: XCTestCase {
XCTAssertEqual(client.executionConfiguration(forMethod: firstDescriptor), overrideConfiguration)
XCTAssertEqual(client.executionConfiguration(forMethod: secondDescriptor), defaultConfiguration)
}

func makeClient(
configuration: ClientRPCExecutionConfiguration? = nil,
server: InProcessServerTransport = InProcessServerTransport()
Expand All @@ -222,10 +222,12 @@ final class InProcessClientTransportTests: XCTestCase {
backoffMultiplier: 1.0,
retryableStatusCodes: [.unavailable]
)

return InProcessClientTransport(
server: server,
executionConfigurations: .init(defaultConfiguration: configuration ?? .init(retryPolicy: defaultPolicy))
executionConfigurations: .init(
defaultConfiguration: configuration ?? .init(retryPolicy: defaultPolicy)
)
)
}
}

0 comments on commit 1e3ccb6

Please sign in to comment.