From b8da0761a67213f5e4e73713bba822d6344ef75f Mon Sep 17 00:00:00 2001 From: Finagolfin Date: Sat, 18 Jan 2025 21:14:39 +0530 Subject: [PATCH] Check if reverting the new NIO test alone fixes the macOS CI --- swift-nio-revert-async.patch | 53 ------------------------------------ 1 file changed, 53 deletions(-) diff --git a/swift-nio-revert-async.patch b/swift-nio-revert-async.patch index 713c2c5..57da87a 100644 --- a/swift-nio-revert-async.patch +++ b/swift-nio-revert-async.patch @@ -1,56 +1,3 @@ -diff --git a/Sources/NIOCore/AsyncSequences/NIOAsyncWriter.swift b/Sources/NIOCore/AsyncSequences/NIOAsyncWriter.swift -index badc34f967..f232d518f9 100644 ---- a/Sources/NIOCore/AsyncSequences/NIOAsyncWriter.swift -+++ b/Sources/NIOCore/AsyncSequences/NIOAsyncWriter.swift -@@ -1173,7 +1173,38 @@ extension NIOAsyncWriter { - delegate: delegate - ) - -- case .initial, .finished, .writerFinished: -+ case .writerFinished( -+ let isWritable, -+ let inDelegateOutcall, -+ var suspendedYields, -+ let cancelledYields, -+ let bufferedYieldIDs, -+ let delegate, -+ let error -+ ): -+ // We have a suspended yield at this point that hasn't been cancelled yet. -+ // It was buffered before we became finished, so we still have to deliver it. -+ // We need to store the yield now. -+ -+ self._state = .modifying -+ -+ let suspendedYield = SuspendedYield( -+ yieldID: yieldID, -+ continuation: continuation -+ ) -+ suspendedYields.append(suspendedYield) -+ -+ self._state = .writerFinished( -+ isWritable: isWritable, -+ inDelegateOutcall: inDelegateOutcall, -+ suspendedYields: suspendedYields, -+ cancelledYields: cancelledYields, -+ bufferedYieldIDs: bufferedYieldIDs, -+ delegate: delegate, -+ error: error -+ ) -+ -+ case .initial, .finished: - preconditionFailure("This should have already been handled by `yield()`") - - case .modifying: -@@ -1501,7 +1532,7 @@ extension NIOAsyncWriter { - - self._state = .writerFinished( - isWritable: isWritable, -- inDelegateOutcall: inDelegateOutcall, -+ inDelegateOutcall: false, - suspendedYields: .init(), - cancelledYields: cancelledYields, - bufferedYieldIDs: bufferedYieldIDs, diff --git a/Tests/NIOCoreTests/AsyncSequences/NIOAsyncWriterTests.swift b/Tests/NIOCoreTests/AsyncSequences/NIOAsyncWriterTests.swift index 31c680b8bf..4f15ac9af9 100644 --- a/Tests/NIOCoreTests/AsyncSequences/NIOAsyncWriterTests.swift