mirror of
https://github.com/apple/swift-nio
synced 2026-11-26 04:57:49 +00:00
Enable strict concurrency for NIOPosixTests (#3211)
This commit is contained in:
1 parent
ae60dc3e07
commit
c420f0d4e6
3 files changed
+6
-5
No files matched your search
+2
-1
@@ -471,7 +471,8 @@ let package = Package(
|
||||
"CNIOLinux",
|
||||
"CNIODarwin",
|
||||
"NIOTLS",
|
||||
]
|
||||
],
|
||||
swiftSettings: strictConcurrencySettings
|
||||
),
|
||||
.testTarget(
|
||||
name: "NIOConcurrencyHelpersTests",
|
||||
|
||||
@@ -508,7 +508,7 @@ class DatagramChannelTests: XCTestCase {
|
||||
// Only run this test on platforms that support recvmmsg: the others won't even
|
||||
// try.
|
||||
#if os(Linux) || os(FreeBSD) || os(Android)
|
||||
final class RecvMmsgHandler: ChannelInboundHandler {
|
||||
final class RecvMmsgHandler: ChannelInboundHandler, Sendable {
|
||||
typealias InboundIn = AddressedEnvelope<ByteBuffer>
|
||||
typealias InboundOut = AddressedEnvelope<ByteBuffer>
|
||||
|
||||
|
||||
@@ -292,7 +292,7 @@ class EventLoopFutureTest: XCTestCase {
|
||||
let promises: [EventLoopPromise<Int>] = (0..<100).map { (_: Int) in eventLoop.makePromise() }
|
||||
let futures = promises.map { $0.futureResult }
|
||||
|
||||
let fN: EventLoopFuture<Int> = EventLoopFuture<Int>.reduce(0, futures, on: eventLoop, +)
|
||||
let fN: EventLoopFuture<Int> = EventLoopFuture<Int>.reduce(0, futures, on: eventLoop) { $0 + $1 }
|
||||
_ = promises.map { $0.fail(E()) }
|
||||
XCTAssert(fN.eventLoop === eventLoop)
|
||||
XCTAssertThrowsError(try fN.wait()) { error in
|
||||
@@ -311,7 +311,7 @@ class EventLoopFutureTest: XCTestCase {
|
||||
|
||||
let futures = promises.map { $0.futureResult }
|
||||
|
||||
let fN: EventLoopFuture<Int> = EventLoopFuture<Int>.reduce(0, futures, on: eventLoop, +)
|
||||
let fN: EventLoopFuture<Int> = EventLoopFuture<Int>.reduce(0, futures, on: eventLoop) { $0 + $1 }
|
||||
XCTAssert(fN.eventLoop === eventLoop)
|
||||
XCTAssertThrowsError(try fN.wait()) { error in
|
||||
XCTAssertNotNil(error as? E)
|
||||
@@ -327,7 +327,7 @@ class EventLoopFutureTest: XCTestCase {
|
||||
promises.insert(failedPromise, at: promises.startIndex)
|
||||
|
||||
let futures = promises.map { $0.futureResult }
|
||||
let fN: EventLoopFuture<Int> = EventLoopFuture<Int>.reduce(0, futures, on: eventLoop, +)
|
||||
let fN: EventLoopFuture<Int> = EventLoopFuture<Int>.reduce(0, futures, on: eventLoop) { $0 + $1 }
|
||||
|
||||
failedPromise.fail(E())
|
||||
|
||||
|
||||
Reference in new issue
Block a user