port: CI hang fixes and workspace-switch condition waits - #914
Closed
nickolas-dimitrakas wants to merge 1 commit into
Closed
nickolas-dimitrakas wants to merge 1 commit into
nickolas-dimitrakas wants to merge 1 commit into
Conversation
Ports the subset of the main-line fixes that workstation/swift-migration is actually missing. - .github/workflows: the #867 simulator and SPM-hang fixes, taken from main after confirming this branch had no independent changes to those files. - MParticleTests: the five workspace-switch tests were still built on nested 10-second dispatch_after chains. Converted to MPWaitForCondition against this branch's own assertions rather than copying main's version, which would have clobbered the migration-specific registeredKits/resetRegistry work here. - MPRoktTests: stop the partial mock before releasing the object it wraps. Deliberately not ported: the kitsRegistry lock fix. It does not apply here. The migration moved the registry into MPKitContainer.swift where registryLock and registry are both static and every accessor takes the lock, so registeredKits already returns a locked copy and removeRegisteredKit: already mutates under the lock. This branch's registry locking is sounder than main's. The Rokt async timeouts and teardown drain are likewise already present here, in a two-pass form more thorough than the main-line version. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
🐦 Swift Migration ProgressProduction implementation code at
Objective-C retained by design: Core SDK 5,801 · SDK kit infrastructure 386 · Standalone kits 0. This PR's code movement
How this is measured
Generated with |
Contributor
Author
|
Superseded by #915 — |
📦 SDK Size Impact ReportMeasures how much the SDK adds to an app's size (with-SDK minus without-SDK).
➡️ SDK size impact change is minimal. Raw measurementsTarget branch (workstation/swift-migration): {"baseline_app_size_kb":84,"baseline_executable_size_bytes":75464,"with_sdk_app_size_kb":2500,"with_sdk_executable_size_bytes":76312,"sdk_impact_kb":2416,"sdk_executable_impact_bytes":848,"xcframework_size_kb":6984}This PR: {"baseline_app_size_kb":84,"baseline_executable_size_bytes":75464,"with_sdk_app_size_kb":2500,"with_sdk_executable_size_bytes":76312,"sdk_impact_kb":2416,"sdk_executable_impact_bytes":848,"xcframework_size_kb":6984} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
CI on PRs targeting this branch is failing and slow. From run 33552140564 (PR #907):
native-unit-tests (tvOS, mParticle-Apple-SDK)testSwitchWorkspaceKitsWithStopnative-unit-tests (iOS, mParticle-Apple-SDK)testActiveKitsRegistryThreadSafetyAnd the workspace tests are burning ~100 seconds of pure fixed delay per run:
None of the main-line fixes for this had reached this branch.
What this ports
CI workflows — the #867 fixes:
-parallel-testing-enabled NO(the Swift scheme was cloning simulators and starving the daemons one test blocks on),simctl bootstatus, a per-test timeout, plus the SPM resolve watchdog and job timeouts inbuild-kits. Taken from main after confirming this branch had no independent changes to those files.Five workspace-switch tests — converted from nested 10-second
dispatch_afterchains toMPWaitForCondition, which spins the main run loop until the SDK is actually ready.dispatch_afterandWORKSPACE_SWITCHING_DELAYare now gone fromMParticleTests. Where a test asserts an outcome that arrives via the flush on the main queue, the wait includes that outcome so it cannot race the flush.These were converted against this branch's own test bodies, not by copying main's file — that would have clobbered the migration-specific
resetRegistry,kitContainer_PRIVATEandregisteredKits.anyObjectwork here.MPRoktTeststeardown — stop the partial mock before releasing the object it wraps, rather than after.Deliberately not ported
The
kitsRegistrylock fix does not apply here. The migration moved the registry intoMPKitContainer.swift, whereregistryLockandregistryare bothstaticand every accessor takes the lock —registeredKitsreturns a locked copy,removeRegisteredKit:mutates under the lock. This branch's registry locking is sounder than main's; porting the fix would have been patching a defect that isn't here.The Rokt async timeouts and teardown drain are already present, and
drainPendingAsyncWorkis a two-pass drain — more thorough than the main-line version.Honest limits
The teardown ordering change is unvalidated.
MPRoktTestson this branch runs 10/10 clean locally both with and without it, so I have no local evidence it does anything. It is correct on its own terms — releasing a mocked object while its partial mock is installed is a real ordering bug — but I am not claiming it fixes anything observed.testActiveKitsRegistryThreadSafetyis not addressed. It crashes on this branch's CI too, and since the Swift registry here is correctly locked, the cause differs from the main-line one I fixed. Still open, still needs its own investigation.Local numbers are Xcode 26.3 / iOS 26; CI is Xcode 16.4 / iOS 18. The workspace-test failures did not reproduce locally at all, so the conversion is justified by the CI evidence above plus the identical fix working on main, not by a local before/after.
🤖 Generated with Claude Code