Summary
When running tests on tvOS devices via apple run --signal-app-end --expected-exit-code 42, XHarness correctly observes mlaunch exiting with the expected exit code (42), but then blocks indefinitely on a background device log reading task instead of using the mlaunch exit code. If the device log stream produces no data (empty log file), XHarness never completes and the Helix workload timeout kills it after 720 seconds.
Root Cause
Comparing passing and failing runs on tvOS 26.2 / macOS 15.7 / Xcode 26.0.1:
Passing (DNCENGTVOS-106):
mlaunch exits with 42 ✅
- XHarness reads device logs → gets
Wall Clock adjustment detected error but file is non-empty
Failed to determine the exit code from .../device-DNCENGTVOS-106-*.log
- Falls back to mlaunch exit code → "Application has finished with exit code: 42 (as expected)" ✅
Failing (DNCENGTVOS-036):
mlaunch exits with 42 ✅
- Device log file is empty (no data streamed from Apple TV)
- XHarness hangs waiting on device log reader — never reaches fallback
- After 720s: "Run timed out after 720 seconds" → exit 143 ❌
Both runs emit the warning: Exit code detection is not working on iOS/tvOS 15+ so the run will fail to match it with the expected value
The critical difference is that the device log stream works on some Apple TV devices but not others. When it doesn't work, XHarness has a blocking dependency on the log reader completing before it can process the mlaunch exit code.
Expected Behavior
When mlaunch exits with the expected exit code and the device log stream is empty/non-responsive, XHarness should not block indefinitely. It should either:
- Use a timeout on the device log reading task, or
- Recognize the mlaunch exit code immediately without waiting for the log stream
Reproduction
This occurs on the osx.15.amd64.appletv.open Helix queue with tvOS 26.2, macOS 15.7, Xcode 26.0.1, and XHarness 11.0.0-prerelease.26064.3.
Affected devices: DNCENGTVOS-036, DNCENGTVOS-022 (device log streaming broken)
Working devices: DNCENGTVOS-106 (device log streaming works)
All are AppleTV5,3 (4th generation), same tvOS version (26.2, build 23K54).
Evidence
Key log lines in failing run:
- Line ~525:
warn: Exit code detection is not working on iOS/tvOS 15+
- Line ~1970:
dbug: Process mlaunch exited with 42
- Line ~1975 (12 min later):
fail: Run timed out after 720 seconds
Key log lines in passing run:
- Line ~1637:
dbug: Process mlaunch exited with 42
- Line ~1640:
dbug: Failed to determine the exit code from .../device-DNCENGTVOS-106-*.log
- Line ~1642:
info: Application has finished with exit code: 42 (as expected)
Impact
This causes ~10% failure rate in the tvos-arm64 Release AllSubsets_CoreCLR_Smoke leg in the dotnet/runtime CI pipeline (definition 129), specifically the iOS.CoreCLR.R2R.Test work item. Failures depend on which Apple TV device the job lands on.
Summary
When running tests on tvOS devices via
apple run --signal-app-end --expected-exit-code 42, XHarness correctly observesmlaunchexiting with the expected exit code (42), but then blocks indefinitely on a background device log reading task instead of using the mlaunch exit code. If the device log stream produces no data (empty log file), XHarness never completes and the Helix workload timeout kills it after 720 seconds.Root Cause
Comparing passing and failing runs on tvOS 26.2 / macOS 15.7 / Xcode 26.0.1:
Passing (DNCENGTVOS-106):
mlaunchexits with 42 ✅Wall Clock adjustment detectederror but file is non-emptyFailed to determine the exit code from .../device-DNCENGTVOS-106-*.logFailing (DNCENGTVOS-036):
mlaunchexits with 42 ✅Both runs emit the warning:
Exit code detection is not working on iOS/tvOS 15+ so the run will fail to match it with the expected valueThe critical difference is that the device log stream works on some Apple TV devices but not others. When it doesn't work, XHarness has a blocking dependency on the log reader completing before it can process the mlaunch exit code.
Expected Behavior
When
mlaunchexits with the expected exit code and the device log stream is empty/non-responsive, XHarness should not block indefinitely. It should either:Reproduction
This occurs on the
osx.15.amd64.appletv.openHelix queue with tvOS 26.2, macOS 15.7, Xcode 26.0.1, and XHarness 11.0.0-prerelease.26064.3.Affected devices: DNCENGTVOS-036, DNCENGTVOS-022 (device log streaming broken)
Working devices: DNCENGTVOS-106 (device log streaming works)
All are AppleTV5,3 (4th generation), same tvOS version (26.2, build 23K54).
Evidence
Key log lines in failing run:
warn: Exit code detection is not working on iOS/tvOS 15+dbug: Process mlaunch exited with 42fail: Run timed out after 720 secondsKey log lines in passing run:
dbug: Process mlaunch exited with 42dbug: Failed to determine the exit code from .../device-DNCENGTVOS-106-*.loginfo: Application has finished with exit code: 42 (as expected)Impact
This causes ~10% failure rate in the
tvos-arm64 Release AllSubsets_CoreCLR_Smokeleg in the dotnet/runtime CI pipeline (definition 129), specifically theiOS.CoreCLR.R2R.Testwork item. Failures depend on which Apple TV device the job lands on.