File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed
Tests/GRPCInProcessTransportTests Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -36,8 +36,20 @@ fileprivate actor TestActor {
36
36
let inProcess = InProcessTransport ( )
37
37
38
38
try await withGRPCServer ( transport: inProcess. server, services: [ ] ) { server in
39
- try await withGRPCClient ( transport: inProcess. client) { client in
40
- self . hasRun = true
39
+ do {
40
+ try await withGRPCClient ( transport: inProcess. client) { client in
41
+ self . hasRun = true
42
+ }
43
+ } catch {
44
+ // Starting the client can race with the closure returning which begins graceful shutdown.
45
+ // If that happens the client run method will throw an error as the client is being run
46
+ // when it's already been shutdown. That's okay and expected so rather than slowing down
47
+ // the closure tolerate that specific error.
48
+ if let error = error as? RuntimeError {
49
+ #expect( error. code == . clientIsStopped)
50
+ } else {
51
+ Issue . record ( error)
52
+ }
41
53
}
42
54
}
43
55
}
You can’t perform that action at this time.
0 commit comments