Skip to content

tvOS: Device communication failures cause false TIMED_OUT and APP_CRASH results after successful test runs #1548

@steveisok

Description

@steveisok

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):

  1. mlaunch exits with 42 ✅
  2. XHarness reads device logs → gets Wall Clock adjustment detected error but file is non-empty
  3. Failed to determine the exit code from .../device-DNCENGTVOS-106-*.log
  4. Falls back to mlaunch exit code → "Application has finished with exit code: 42 (as expected)"

Failing (DNCENGTVOS-036):

  1. mlaunch exits with 42 ✅
  2. Device log file is empty (no data streamed from Apple TV)
  3. XHarness hangs waiting on device log reader — never reaches fallback
  4. 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.

Metadata

Metadata

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions