PR changes

This commit is contained in:
Gus Cairo 2025-04-15 15:08:35 +01:00
parent d597722cca
commit a19c933c37
2 changed files with 15 additions and 7 deletions

View File

@ -18,7 +18,7 @@ import XCTest
import Network
import NIOCore
import NIOEmbedded
@testable import NIOTransportServices
import NIOTransportServices
import NIOConcurrencyHelpers
import Foundation
@ -384,10 +384,16 @@ final class NIOTSBootstrapTests: XCTestCase {
func channelActive(context: ChannelHandlerContext) {
self.connectionPromise.succeed()
context.pipeline.fireChannelActive()
}
}
let group = NIOTSEventLoopGroup(loopCount: 1)
let group = NIOTSEventLoopGroup()
defer {
Task {
try await group.shutdownGracefully()
}
}
let configuratorListenerCounter = NIOLockedValueBox(0)
let configuratorConnectionCounter = NIOLockedValueBox(0)
@ -422,8 +428,6 @@ final class NIOTSBootstrapTests: XCTestCase {
XCTAssertEqual(2, configuratorListenerCounter.withLockedValue { $0 })
XCTAssertEqual(1, configuratorConnectionCounter.withLockedValue { $0 })
try await group.shutdownGracefully()
}
}

View File

@ -245,10 +245,16 @@ final class NIOTSDatagramConnectionChannelTests: XCTestCase {
func channelActive(context: ChannelHandlerContext) {
self.connectionPromise.succeed()
context.fireChannelActive()
}
}
let group = NIOTSEventLoopGroup(loopCount: 1)
let group = NIOTSEventLoopGroup()
defer {
Task {
try await group.shutdownGracefully()
}
}
let configuratorListenerCounter = NIOLockedValueBox(0)
let configuratorConnectionCounter = NIOLockedValueBox(0)
@ -288,8 +294,6 @@ final class NIOTSDatagramConnectionChannelTests: XCTestCase {
XCTAssertEqual(2, configuratorListenerCounter.withLockedValue { $0 })
XCTAssertEqual(1, configuratorConnectionCounter.withLockedValue { $0 })
try await group.shutdownGracefully()
}
func testCanExtractTheConnection() throws {