diff --git a/IntegrationTests/allocation-counter-tests-framework/run-allocation-counter.sh b/IntegrationTests/allocation-counter-tests-framework/run-allocation-counter.sh index d780715ea..dab707628 100755 --- a/IntegrationTests/allocation-counter-tests-framework/run-allocation-counter.sh +++ b/IntegrationTests/allocation-counter-tests-framework/run-allocation-counter.sh @@ -40,7 +40,7 @@ function hooked_package_swift_start() { shift 2 cat <<"EOF" -// swift-tools-version:5.1 +// swift-tools-version:5.7 import PackageDescription let package = Package( @@ -61,8 +61,9 @@ EOF cat < Package.swift < "$tmpdir/syscallwrapper/Package.swift" <<"EOF" -// swift-tools-version:5.2 +// swift-tools-version:5.7 // The swift-tools-version declares the minimum version of Swift required to build this package. import PackageDescription diff --git a/Sources/NIOCrashTester/CrashTests+EventLoop.swift b/Sources/NIOCrashTester/CrashTests+EventLoop.swift index 7ce7f4a3e..d3b0234ee 100644 --- a/Sources/NIOCrashTester/CrashTests+EventLoop.swift +++ b/Sources/NIOCrashTester/CrashTests+EventLoop.swift @@ -180,7 +180,7 @@ struct EventLoopCrashTests { NIOSingletons.groupLoopCountSuggestion = -1 } - #if compiler(>=5.9) // We only support Concurrency executor take-over on 5.9+ + #if compiler(>=5.9) && swift(<5.11) // We only support Concurrency executor take-over on 5.9-5.10, as versions greater than 5.10 have not been properly tested. let testInstallingSingletonMTELGAsConcurrencyExecutorWorksButOnlyOnce = CrashTest( regex: #"Fatal error: Must be called only once"# ) { @@ -207,6 +207,6 @@ struct EventLoopCrashTests { // This should crash _ = NIOSingletons.unsafeTryInstallSingletonPosixEventLoopGroupAsConcurrencyGlobalExecutor() } - #endif // compiler(>=5.9) + #endif // compiler(>=5.9) && swift(<5.11) } #endif // !canImport(Darwin) || os(macOS) diff --git a/Tests/NIOCoreTests/AsyncSequences/NIOThrowingAsyncSequenceTests.swift b/Tests/NIOCoreTests/AsyncSequences/NIOThrowingAsyncSequenceTests.swift index 3e71d7198..237be2c28 100644 --- a/Tests/NIOCoreTests/AsyncSequences/NIOThrowingAsyncSequenceTests.swift +++ b/Tests/NIOCoreTests/AsyncSequences/NIOThrowingAsyncSequenceTests.swift @@ -860,18 +860,18 @@ final class NIOThrowingAsyncSequenceProducerTests: XCTestCase { } func testIteratorThrows_whenCancelled() async { - _ = self.source.yield(contentsOf: Array(0..<100)) + _ = self.source.yield(contentsOf: Array(1...100)) await withThrowingTaskGroup(of: Void.self) { group in group.addTask { - var counter = 0 + var itemsYieldedCounter = 0 guard let sequence = self.sequence else { return XCTFail("Expected to have an AsyncSequence") } do { for try await next in sequence { - XCTAssertEqual(next, counter) - counter += 1 + itemsYieldedCounter += 1 + XCTAssertEqual(next, itemsYieldedCounter) } XCTFail("Expected that this throws") } catch is CancellationError { @@ -880,7 +880,7 @@ final class NIOThrowingAsyncSequenceProducerTests: XCTestCase { XCTFail("Unexpected error: \(error)") } - XCTAssertLessThan(counter, 100) + XCTAssertLessThanOrEqual(itemsYieldedCounter, 100) } group.cancelAll() diff --git a/dev/make-single-file-spm b/dev/make-single-file-spm index 2b9c990d0..049062106 100755 --- a/dev/make-single-file-spm +++ b/dev/make-single-file-spm @@ -51,7 +51,7 @@ function setup_swiftpm_package() { cd "$destination" cat > Package.swift <<"EOF" -// swift-tools-version:5.1 +// swift-tools-version:5.7 import PackageDescription var targets: [PackageDescription.Target] = [