From a0162248546fa4de2396167b3e113c44a2b5f5a3 Mon Sep 17 00:00:00 2001 From: Honza Dvorsky Date: Mon, 24 Mar 2025 12:19:18 +0100 Subject: [PATCH] [DO NOT MERGE] Debug PR --- .github/workflows/pull_request.yml | 21 ++++++++++++ .../ActorTestKitTests.swift | 31 ++++++++++++++++++ .../ActorRefAdapterTests.swift | 32 +++++++++++++++++++ 3 files changed, 84 insertions(+) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 85c60d267..f756f66e9 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -42,3 +42,24 @@ jobs: uses: apple/swift-nio/.github/workflows/cxx_interop.yml@main with: linux_5_9_enabled: false + + split-build-test: + name: Build and test separately + runs-on: ubuntu-latest + container: + image: "swiftlang/swift:nightly-main-jammy" + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + persist-credentials: false + submodules: true + - name: Mark the workspace as safe + # https://github.com/actions/checkout/issues/766 + run: git config --global --add safe.directory ${GITHUB_WORKSPACE} + - name: Build + run: | + swift build --explicit-target-dependency-import-check error -Xswiftc -require-explicit-sendable + - name: Test + run: | + swift test --explicit-target-dependency-import-check error -Xswiftc -require-explicit-sendable diff --git a/Tests/DistributedActorsTestKitTests/ActorTestKitTests.swift b/Tests/DistributedActorsTestKitTests/ActorTestKitTests.swift index 86ae009c8..308958402 100644 --- a/Tests/DistributedActorsTestKitTests/ActorTestKitTests.swift +++ b/Tests/DistributedActorsTestKitTests/ActorTestKitTests.swift @@ -12,11 +12,42 @@ // //===----------------------------------------------------------------------===// +#if os(Linux) +@preconcurrency import Glibc +#endif import XCTest @testable import DistributedActorsTestKit @testable import DistributedCluster +final class _ForceFlush1StartTest: XCTestCase { + override class func setUp() { + super.setUp() + + fflush(stdout) + fflush(stderr) + for channel in [0, 1] as [Int32] { + write(channel, Array(repeating: UInt8(ascii: "_"), count: 32*1024) + [UInt8(ascii: "\n"), 0], 32*1024 + 2) + } + } + + func test() {} +} + +final class Z_ForceFlush1EndTest: XCTestCase { + override class func setUp() { + super.setUp() + + fflush(stdout) + fflush(stderr) + for channel in [0, 1] as [Int32] { + write(channel, Array(repeating: UInt8(ascii: "_"), count: 32*1024) + [UInt8(ascii: "\n"), 0], 32*1024 + 2) + } + } + + func test() {} +} + final class ActorTestKitTests: XCTestCase { var system: ClusterSystem! var testKit: ActorTestKit! diff --git a/Tests/DistributedClusterTests/ActorRefAdapterTests.swift b/Tests/DistributedClusterTests/ActorRefAdapterTests.swift index 54065b234..8d8804d38 100644 --- a/Tests/DistributedClusterTests/ActorRefAdapterTests.swift +++ b/Tests/DistributedClusterTests/ActorRefAdapterTests.swift @@ -12,12 +12,44 @@ // //===----------------------------------------------------------------------===// +#if os(Linux) +@preconcurrency import Glibc +#endif + import DistributedActorsTestKit import Foundation import XCTest @testable import DistributedCluster +final class __ForceFlush2StartTest: XCTestCase { + override class func setUp() { + super.setUp() + + fflush(stdout) + fflush(stderr) + for channel in [0, 1] as [Int32] { + write(channel, Array(repeating: UInt8(ascii: "_"), count: 32*1024) + [UInt8(ascii: "\n"), 0], 32*1024 + 2) + } + } + + func test() {} +} + +final class Z_ForceFlush2EndTest: XCTestCase { + override class func setUp() { + super.setUp() + + fflush(stdout) + fflush(stderr) + for channel in [0, 1] as [Int32] { + write(channel, Array(repeating: UInt8(ascii: "_"), count: 32*1024) + [UInt8(ascii: "\n"), 0], 32*1024 + 2) + } + } + + func test() {} +} + class _ActorRefAdapterTests: SingleClusterSystemXCTestCase { func test_adaptedRef_shouldConvertMessages() throws { let probe = self.testKit.makeTestProbe(expecting: String.self)