diff --git a/.github/workflows/base_build.yaml b/.github/workflows/base_build.yaml index 3ac7a9dae..3eed5a0a5 100644 --- a/.github/workflows/base_build.yaml +++ b/.github/workflows/base_build.yaml @@ -14,13 +14,13 @@ on: jobs: build: - runs-on: [macos-14] + runs-on: [macos-latest] steps: - name: Select Xcode uses: maxim-lobanov/setup-xcode@v1 with: - xcode-version: 15.4.0 + xcode-version: 16 - name: Checkout uses: actions/checkout@v4 @@ -31,7 +31,7 @@ jobs: uses: sersoft-gmbh/xcodebuild-action@v3 with: action: build - build-settings: ONLY_ACTIVE_ARCH=NO TEST_AFTER_BUILD=NO + build-settings: ONLY_ACTIVE_ARCH=NO TEST_AFTER_BUILD=NO SWIFT_VERSION=5.9 configuration: Debug derived-data-path: "${{ github.workspace }}/SplitApp" destination: ${{ inputs.destination }} diff --git a/.github/workflows/base_ut.yaml b/.github/workflows/base_ut.yaml index 8aedeaae8..b71660d8a 100644 --- a/.github/workflows/base_ut.yaml +++ b/.github/workflows/base_ut.yaml @@ -13,13 +13,13 @@ on: jobs: test: - runs-on: [macos-14] + runs-on: [macos-latest] steps: - name: Select Xcode uses: maxim-lobanov/setup-xcode@v1 with: - xcode-version: 15.4.0 + xcode-version: 16 - name: Checkout uses: actions/checkout@v4 @@ -30,7 +30,7 @@ jobs: uses: sersoft-gmbh/xcodebuild-action@v3 with: action: test - build-settings: ONLY_ACTIVE_ARCH=NO + build-settings: ONLY_ACTIVE_ARCH=NO SWIFT_VERSION=5.9 configuration: Debug derived-data-path: "${{github.workspace}}/SplitApp" destination: ${{ inputs.destination }} diff --git a/.github/workflows/sonar.yml b/.github/workflows/sonar.yml index 95a9fbc4f..716383bae 100644 --- a/.github/workflows/sonar.yml +++ b/.github/workflows/sonar.yml @@ -13,7 +13,7 @@ concurrency: jobs: build-and-collect-coverage: name: Build & Collect Coverage - runs-on: macos-15 + runs-on: macos-latest timeout-minutes: 15 steps: - name: Checkout @@ -28,7 +28,7 @@ jobs: -project Split.xcodeproj \ -scheme Split \ -testPlan "SplitiOSFull" \ - -destination 'platform=iOS Simulator,OS=18.4,name=iPhone 16' \ + -destination 'platform=iOS Simulator,OS=18.4,name=iPhone 16 Pro Max' \ -enableCodeCoverage YES \ -resultBundlePath build/Logs/Test/TestResults.xcresult \ -derivedDataPath build diff --git a/.github/workflows/test_all.yaml b/.github/workflows/test_all.yaml index 534026ada..012280dbd 100644 --- a/.github/workflows/test_all.yaml +++ b/.github/workflows/test_all.yaml @@ -36,4 +36,4 @@ jobs: uses: ./.github/workflows/base_ut.yaml with: test-plan: ${{ matrix.plan }} - destination: 'platform=iOS Simulator,OS=17.2,name=iPhone 15' + destination: 'platform=iOS Simulator,name=iPhone 16,OS=latest' diff --git a/.github/workflows/xcframework.yaml b/.github/workflows/xcframework.yaml index b8076747c..f2457100e 100644 --- a/.github/workflows/xcframework.yaml +++ b/.github/workflows/xcframework.yaml @@ -14,7 +14,7 @@ jobs: - name: Select Xcode uses: maxim-lobanov/setup-xcode@v1 with: - xcode-version: 15.1.0 + xcode-version: 16 - uses: actions/checkout@v2 - uses: actions/setup-python@v2 diff --git a/SplitTests/Fake/Network/TelemetryProducerStub.swift b/SplitTests/Fake/Network/TelemetryProducerStub.swift index 1dae5d0a1..8689d01ab 100644 --- a/SplitTests/Fake/Network/TelemetryProducerStub.swift +++ b/SplitTests/Fake/Network/TelemetryProducerStub.swift @@ -28,6 +28,8 @@ class TelemetryStorageStub: TelemetryStorage { var impressions = [TelemetryImpressionsDataType: Int]() var events = [TelemetryEventsDataType: Int]() + var lock = NSLock() + var isFactoryDataRecorded = Atomic(false) func recordLastSync(resource: Resource, time: Int64) { @@ -148,6 +150,8 @@ class TelemetryStorageStub: TelemetryStorage { } func popTags() -> [String] { + lock.lock() + defer { lock.unlock() } popTagsCallCount+=1 return [] } diff --git a/SplitTests/Fake/Storage/MySegmentsStorageStub.swift b/SplitTests/Fake/Storage/MySegmentsStorageStub.swift index 072d466ba..7b5b403f9 100644 --- a/SplitTests/Fake/Storage/MySegmentsStorageStub.swift +++ b/SplitTests/Fake/Storage/MySegmentsStorageStub.swift @@ -20,6 +20,8 @@ class MySegmentsStorageStub: MySegmentsStorage { var getCountByKeyCalledCount = 0 var getCountCalledCount = 0 var changeNumber: Int64 = -1 + + var lock = NSLock() var keys: Set { return Set(segments.keys.map { $0 }) @@ -69,6 +71,8 @@ class MySegmentsStorageStub: MySegmentsStorage { } func getCount() -> Int { + lock.lock() + defer { lock.unlock() } getCountCalledCount+=1 var count = 0 for (_, value) in segments { diff --git a/SplitTests/Service/Telemetry/TelemetryStatsRecorderWorkerTests.swift b/SplitTests/Service/Telemetry/TelemetryStatsRecorderWorkerTests.swift index f3f9f5207..39dfea680 100644 --- a/SplitTests/Service/Telemetry/TelemetryStatsRecorderWorkerTests.swift +++ b/SplitTests/Service/Telemetry/TelemetryStatsRecorderWorkerTests.swift @@ -94,6 +94,7 @@ class TelemetryStatsRecorderWorkerTests: XCTestCase { statsRecorder.queue = DispatchQueue(label: "pepe") let queue = DispatchQueue(label: "concurrent-test", attributes: .concurrent) let group = DispatchGroup() + let expectation = self.expectation(description: "Concurrent flush finished") for _ in 0..<6 { group.enter() @@ -110,6 +111,9 @@ class TelemetryStatsRecorderWorkerTests: XCTestCase { XCTAssertEqual(6, self.mySegmentsStorage.getCountCalledCount) XCTAssertEqual(6, self.myLargeSegmentsStorage.getCountCalledCount) XCTAssertEqual(6, self.telemetryStorage.popTagsCallCount) + expectation.fulfill() } + + waitForExpectations(timeout: 5) } }