We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 25ce8b2 commit ce0fdedCopy full SHA for ce0fded
1 file changed
Tests/NIOHTTPServerTests/NIOHTTPServer+ServiceLifecycleTests.swift
@@ -184,6 +184,13 @@ struct NIOHTTPServiceLifecycleTests {
184
// Wait for the server to shut down.
185
try await group.waitForAll()
186
187
+ // Wait for the client channel to be fully closed. The server has closed
188
+ // its side of the connection, but the client's event loop may not have
189
+ // processed the TCP FIN/RST yet. closeFuture completes only once the
190
+ // channel is fully inactive, which is a stronger guarantee than just
191
+ // draining inbound (which may return while the channel is half-closed).
192
+ try await client.channel.closeFuture.get()
193
+
194
// We shouldn't be able to complete our request; the server should have shut down.
195
await #expect(throws: ChannelError.ioOnClosedChannel) {
196
try await outbound.write(Self.reqBody)
0 commit comments