Skip to content

[CI Postmortem] Widespread LaunchTimedOut failures on iOS/tvOS simulator tests #25299

Open

Description

@rolfbjarne

Description

Simulator-based tests (iOS and tvOS) are randomly failing with LaunchTimedOut across multiple test suites (linker, monotouch, fsharp, xcframework, introspection). When this occurs, typically ALL tests in the affected test suite on a given agent fail, suggesting the issue is at the agent/simulator level rather than individual test level.

macOS and Mac Catalyst tests are never affected (they don't use simulators).

Mechanism

The LaunchTimedOut result is set when the test app fails to connect back to the TCP listener within LaunchTimeout (3 minutes in CI). This means either:

  • The simulator fails to boot
  • The app fails to install on the simulator
  • The app crashes immediately at startup before establishing a TCP connection
  • Network/port connectivity issues between the simulator and the host

The relevant code path: tests/xharness/AppRunner.cs line 287-290 sets a 3-minute timeout on listener.ConnectedTask, and tests/xharness/TestReporter.cs line 470 categorizes it as LaunchTimedOut when TestExecutionStarted is false (i.e. the listener never received a connection).

Frequency

This has been happening frequently over the past 2+ weeks. Here are all occurrences from April 20 - May 3, 2026:

Date Build ID # Failed PR
2026-04-20 13882756 23 #25105
2026-04-20 13882766 23 #25105
2026-04-23 13918176 4 #25233
2026-04-24 13929603 22 #25243
2026-04-27 13945394 6 #25246
2026-04-27 13944752 28 #25251
2026-04-27 13944778 24 #25238
2026-04-27 13945852 2 #25197
2026-04-27 13946259 2 #25254
2026-04-28 13952590 2 #25197
2026-04-28 13952530 21 #25261
2026-04-28 13952539 15 #25197
2026-04-28 13954991 2 #25261
2026-04-28 13954558 37 #25262
2026-04-28 13955255 6 #25197
2026-04-28 13955774 2 #25254
2026-04-28 13956330 4 #25239
2026-04-28 13956481 2 #25274
2026-04-28 13956372 24 #25272
2026-04-28 13956568 2 #25274
2026-04-28 13957432 11 #25277
2026-04-28 13957717 15 #25197
2026-04-29 13959788 15 #25261
2026-04-29 13965758 15 #25197
2026-04-29 13968350 2 #25271
2026-04-29 13968391 11 #25277
2026-04-30 13977914 16 #25282
2026-04-30 13980444 2 #25234
2026-04-30 13980447 2 #25234
2026-04-30 13981379 2 #25239
2026-04-30 13981376 2 #25239
2026-04-30 13983337 2 #25286
2026-04-30 13983369 2 #25292
2026-04-30 13983599 11 #25293
2026-04-30 13983087 16 #25291
2026-05-01 13989124 22 #25294
2026-05-01 13989221 4 #25294
2026-05-02 13998898 43 #25296
2026-05-02 13998894 22 #25282
2026-05-03 14001884 15 #25294
2026-05-03 14001881 6 #25294

Affected test suites

All simulator-based test suites are affected:

  • linker tests (dont link, link sdk, link all, trimmode copy, trimmode link)
  • monotouch tests (iOS, tvOS)
  • fsharp tests
  • xcframework tests
  • introspection tests

Only iOS and tvOS simulator tests are affected — macOS and Mac Catalyst tests are never affected.

Observations

  1. When it hits, it tends to affect all tests in a test suite run, not just individual ones.
  2. There is no correlation with any specific PR or code change — it happens across unrelated PRs.
  3. The simctl diagnose step that could provide diagnostic info is currently gated on system.debug == true (line 152 of run-tests.yml), so diagnostic info is rarely captured.
  4. The 3-minute LaunchTimeout in CI (Harness.cs line 266) may be too short if the agent is under load.

Possible improvements

  1. Always run simctl diagnose when a LaunchTimedOut occurs (not just when system.debug is true).
  2. Add diagnostic logging in TestReporter.LaunchCallback and AppRunner to capture simulator state (running simulators, device availability) when the launch times out.
  3. Consider increasing LaunchTimeout from 3 minutes to something higher (e.g., 5 minutes).
  4. Log the agent name in the test result comment to help identify if specific agents are problematic.

Originally reported

#25282 (comment)

Activity

  1. added
    ci-postmortem
    on May 4, 2026
  2. added this to the Future milestone on May 4, 2026
  3. rolfbjarne commented on May 6, 2026

    @rolfbjarne
    MemberAuthor

    New Finding: sqlite3 Crashes Correlated with LaunchTimedOut

    Investigation of build 14015787 (which also hit the LaunchTimedOut failure for interdependent-binding-projects on both iOS and tvOS) reveals:

    sqlite3 crash reports at exact failure times

    The crash report section of the log shows these entries marked with x (occurred during the test run):

    x  2026-05-05 09:14:00Z sqlite3-2026-05-05-051400.ips
    x  2026-05-05 09:20:08Z sqlite3-2026-05-05-052008.ips
    
    • iOS test launched at 09:14:05 → sqlite3 crashed at 09:14:00 (5 seconds earlier)
    • tvOS test launched at 09:20:13 → sqlite3 crashed at 09:20:08 (5 seconds earlier)

    High load average

    Load averages: 6.97  5.37  3.99
    

    Historical sqlite3 crash pattern

    The same machine shows extensive sqlite3 crash history:

    • April 28: 6 crashes
    • April 30: 9 crashes
    • May 4: 4 crashes
    • May 5: 6+ crashes (including during our test run)

    Hypothesis

    The simulator uses sqlite3 for internal state management. Under high load (6.97 average), sqlite3 operations crash, preventing the simulator from properly launching apps. The test harness waits for the app to connect back (TCP), but the app never launches successfully due to the sqlite3 failure, and the 3-minute timeout fires.

    Next steps

    • Add diagnostic logging to the Jenkins main log (not just the per-test Run log) so we can see it in pipeline output
    • Consider whether we should retry on LaunchTimedOut (since this appears to be a transient machine/simulator issue)
  4. rolfbjarne commented on May 11, 2026

    @rolfbjarne
    MemberAuthor

    Build 14048402 (May 8) Analysis

    Retry mechanism is now working correctly

    The Finished flag fix (commit eafc72b) works — retry messages appear and the code correctly re-runs:

    interdependent-binding-projects (log 2089):

    • iOS: timed out at 11:59:17, retried → timed out again at 12:03:52 ❌
    • tvOS: timed out at 12:09:59, retried → timed out again at 12:14:33 ❌
    • sqlite3 crashes: x 11:54:39 and x 12:05:21

    xcframework (log 2083):

    • iOS: timed out at 11:59:00, retried → timed out again at 12:03:34 ❌
    • tvOS: timed out at 12:09:43, retried → timed out again at 12:14:17 ❌
    • sqlite3 crashes: x 11:54:22 and x 12:05:05

    monotouch_tvos (log 2334) — different failure:

    • No LaunchTimedOut, just a regular test failure
    • dotnet process crashed: x 12:08:08 dotnet-2026-05-08-075241.ips
    • sqlite3 crash: x 12:08:08
    • Load average reached 7.59 during the run

    Key observation

    The retries don't help because the sqlite3 crashes persist throughout the test run on these machines. The problem is at the CI machine level — the sqlite3 crash pattern on these machines continues from day to day and cannot be resolved by simple retries. The machines need maintenance (OS reinstall or Xcode update).

  5. rolfbjarne commented on May 11, 2026

    @rolfbjarne
    MemberAuthor

    CI Bot Analysis

    Analyzed 23 builds across the sim-pr-tests pipeline (May 3-11) to determine if LaunchTimedOut failures are concentrated on specific machines.

    Results

    • 111 different machines ran simulator tests in this window
    • 20 machines (18%) experienced at least one failure
    • 91 machines (82%) had zero failures
    • Failures are spread across both VSCXSDKs-MINI and MACIOSMINI pools

    Machines with simulator test failures

    Machine Runs Failures Rate
    VSCXSDKs-MINI-013 3 2 67%
    VSCXSDKs-MINI-008 2 2 100%
    VSCXSDKs-MINI-055 2 2 100%
    VSCXSDKs-MINI-046 4 1 25%
    VSCXSDKs-MINI-050 3 1 33%
    VSCXSDKs-MINI-071 2 1 50%
    VSCXSDKs-MINI-092 2 1 50%
    MACIOSMINI-033 2 1 50%
    MACIOSMINI-032 2 1 50%
    VSCXSDKs-MINI-062 2 1 50%
    VSCXSDKs-MINI-067 1 1 100%
    VSCXSDKs-MINI-047 1 1 100%
    + 8 more machines with 1 failure each

    Machines that never failed (sample)

    Machine Successful Runs
    VSCXSDKs-MINI-010 6
    VSCXSDKs-MINI-014 5
    VSCXSDKs-MINI-009, 021, 022, 025, 032, 033, 051 4 each
    VSCXSDKs-MINI-007, 011, 012, 015, 027 3-4 each

    Conclusion

    The problem is NOT machine-specific. Failures are distributed across 20+ different machines in a pool of 111+, with no concentration on particular hardware. Any machine can be affected.

    This is consistent with our earlier finding that sqlite3 crashes under high load trigger the issue — any machine in the pool can experience load spikes that cause simulator launch failures. The root cause is systemic to the infrastructure/macOS environment, not specific hardware.

    The retry mechanism we added confirms this — retries on the same machine fail because the condition (sqlite3 crashes) persists for the duration of the test run on that machine.

  6. rolfbjarne commented on May 18, 2026

    @rolfbjarne
    MemberAuthor

    CI Post-Mortem Update (May 11–18, 2026)

    App/test launch timeouts continue to be the most widespread issue this week.

    Summary

    • 188 timeout failures across 18 PRs and 27 builds
    • Tests affected: monotouch, introspection, fsharp, interdependent-binding-projects, xcframework, linker (all configurations)
    • Distributed across 97 different bots — not correlated with any specific machine

    Occurrence Table (sample)

    PR Build Timeouts Date
    #25320 14076774 22 May 12
    #25434 14099281 26 May 14
    #25376 14099936 26 May 14
    #25318 14086348 22 May 13
    #25331 14096627 22 May 14
    #25374 14062959 4 May 12
    #22392 14065592 2 May 12
    #25405 14077010 4 May 13
    #25360 14097082 8 May 14
    #25230 14114271 4 May 16

    All 18 affected PRs: #22392, #25230, #25318, #25320, #25331, #25359, #25360, #25374, #25376, #25379, #25392, #25393, #25398, #25405, #25413, #25415, #25428, #25434

    Error Pattern

    <test_name> <config> Test run timed out after 15 minute(s) on bot <bot_name>.
    

    Bot Distribution (top 5)

    Bot Timeout Jobs
    VSCXSDKs-MINI-013 8
    VSCXSDKs-MINI-028 7
    VSCXSDKs-MINI-054 5
    VSCXSDKs-MINI-012 5
    VSCXSDKs-MINI-047 5

    Failures are evenly distributed, confirming this is a systemic issue rather than a bot-specific problem.


    Automated CI post-mortem analysis

  7. rolfbjarne commented on May 20, 2026

    @rolfbjarne
    MemberAuthor

    CI Post-Mortem Update (May 14–20, 2026)

    LaunchTimedOut / execution timeout failures continued this week — 5 failures across 3 PRs, all on May 21, 2026.

    Failures

    PR Build Job Bot Failure Direct Link
    #25458 14145891 T: monotouch_macos VSCXSDKs-MINI-046 TimedOut (1200s) + crash Run tests
    #25483 14146321 T: interdependent-binding-projects VSCXSDKs-MINI-064 LaunchTimedOut (iOS + tvOS) Run tests
    #25482 14146206 T: fsharp VSCXSDKs-MINI-035 LaunchTimedOut (iOS + tvOS) Run tests

    Analysis

    • All three PRs are unrelated (different authors, different changes)
    • The LaunchTimedOut failures hit iOS and tvOS simulator tests as expected
    • The monotouch_macos timeout (PR#25458) is a macOS app timeout (1200s execution limit), which is slightly different from the simulator LaunchTimedOut but indicates the same general "test runner hangs" category
    • Different bots affected (MINI-035, MINI-046, MINI-064) — not bot-specific
    • 5 failures this week vs 188 failures last week — significant improvement

    Comparison

    Last week (May 11–18): 188 failures across 18 PRs on 27 builds, distributed across 97 bots.
    This week (May 14–20): 5 failures across 3 PRs — a ~97% reduction in occurrences.


    This comment was automatically generated by CI post-mortem analysis.

  8. rolfbjarne commented on May 25, 2026

    @rolfbjarne
    MemberAuthor

    CI Post-Mortem Update (May 18–25, 2026)

    LaunchTimedOut failures continued this week across 7 PRs (5 targeting main, 2 targeting net11.0).

    Total: 239 LaunchTimedOut occurrences across 8 builds.

    Occurrence Summary

    Date Build PR Branch Suite Platform # Timeouts
    2026-05-21 14157371 #25230 main introspection ios, tvos 4
    2026-05-21 14157371 #25230 main linker_ios ios 11
    2026-05-21 14157046 #25484 main fsharp, linker_ios ios, tvos 13
    2026-05-21 14158315 #25318 main introspection, linker_ios, linker_tvos ios, tvos 26
    2026-05-21 14159388 #25487 main linker_tvos, monotouch_tvos tvos 29
    2026-05-22 14169173 #25482 main monotouch_ios ios 18
    2026-05-24 14181387 #25379 net11.0 introspection, linker, monotouch_ios, monotouch_tvos ios, tvos 76
    2026-05-24 14181391 #25379 net11.0 introspection, monotouch_ios ios, tvos 30
    2026-05-25 14168561 #25502 net11.0 interdependent_binding_projects, introspection, monotouch_ios ios, tvos 32

    Key Observations

    • Still not machine-specific: failures seen across 15+ different bots (all VSCXSDKs-MINI-*.Tahoe.arm64).
    • Both iOS and tvOS simulators affected. macOS and Mac Catalyst tests remain unaffected.
    • When an agent hits this issue, typically all simulator test configurations in that suite time out — consistent with the agent-level simulator issue hypothesis.
    • Suites affected this week: linker_ios, linker_tvos, introspection, monotouch_ios, monotouch_tvos, fsharp, interdependent_binding_projects.

    Updated by automated CI post-mortem analysis.

  9. rolfbjarne commented on Jun 1, 2026

    @rolfbjarne
    MemberAuthor

    CI Post-Mortem Update (May 25 – Jun 1, 2026)

    LaunchTimedOut failures remain highly prevalent this week — 648 occurrences across 15 main-targeting PRs.

    Summary

    Date Build PR # Timeouts Suites Affected
    2026-05-27 14190538 #25520 46 monotouch, linker, fsharp, introspection
    2026-05-27 14191815 #25521 73 monotouch, linker, fsharp, introspection
    2026-05-27 14193262 #25523 46 monotouch, linker, fsharp, introspection
    2026-05-27 14193325 #25524 66 monotouch, linker, fsharp, introspection
    2026-05-27 14204918 #25537 31 monotouch, fsharp
    2026-05-27 14204981 #25538 15 monotouch, fsharp
    2026-05-28 14207258 #25546 4 fsharp
    2026-05-29 14207519 #25547 44 monotouch, linker, fsharp
    2026-05-31 14226495 #25568 70 monotouch, linker, fsharp, introspection
    2026-05-31 14232792 #25572 91 monotouch, linker, fsharp, introspection, xcframework
    2026-06-01 14219070 #25527 80 monotouch, linker, fsharp, introspection
    2026-06-01 14217952 #25558 28 monotouch, linker, fsharp

    (Plus 4 more builds with smaller counts)

    Total this week: 648 timeouts across 16 builds from 15 PRs.

    Observations

    • Frequency remains consistent (was 239 last week, but this week covers more PRs).
    • Still iOS and tvOS simulators only — macOS and Mac Catalyst unaffected.
    • Still not machine-specific — spread across many different VSCXSDKs-MINI bots.
    • When one agent hits this, typically ALL simulator test configs in that suite time out, consistent with agent-level simulator infrastructure failure.

    Updated by automated CI post-mortem analysis.

  10. rolfbjarne commented on Jun 15, 2026

    @rolfbjarne
    MemberAuthor

    CI Post-Mortem Update (June 8–15, 2026)

    LaunchTimedOut failures were observed again this week on iOS simulator tests.

    Occurrence Summary

    PR Build Suite Bot Configs Affected Direct Link
    #25657 14376282 introspection VSCXSDKs-MINI-033.Tahoe.arm64 29 (all iOS sim configs) introspection → Run tests
    #25607 14376288 linker_ios MACIOSMINI-032.Tahoe.arm64 21 (all linker iOS configs) linker_ios → Run tests

    Total: 2 occurrences across 2 unrelated PRs this week.

    Notes

    • Both occurrences are on different bots (VSCXSDKs-MINI-033 vs MACIOSMINI-032), so this is not a single bad bot.
    • In both cases, ALL iOS simulator configurations in the affected suite timed out — consistent with the pattern described in this issue where the simulator infrastructure on a bot is broken for the entire run.
    • Neither build has a rerun, so we cannot confirm whether they would pass on retry.

    This comment was automatically generated by CI post-mortem analysis.

  11. linked a pull request that will close this issue[devops] Use ACES pools for PRs. #25760on Jun 25, 2026
  12. rolfbjarne commented on Jun 25, 2026

    @rolfbjarne
    MemberAuthor

    Hopefully this will be fixed by moving to ACES bots.

  13. dalexsoto commented on Jul 22, 2026

    @dalexsoto
    Member

    Reopening: the closure expected the move to ACES bots to resolve this class of simulator failures, but #26206 build 14731892 attempt 2 — monotouch_ios reproduced it on AcesShared 18.

    Three newly confirmed failure records on one monitored PR:

    • Debug, PrepareAssemblies + inline dlfcn + don't link: LaunchTimedOut.
    • Debug, static registrar: 15-minute app execution timeout.
    • Release, compat inline dlfcn: 15-minute app execution timeout.

    All used the same already-booted iPhone 14 / iOS 27.0 simulator and timed out after successful simulator boot. This directly invalidates the ACES-migration closure rationale. Build 14731892 is still completing publish tasks, so simulator attempt 3 is deferred until the run is terminal and retry gates can be refreshed.

  14. dalexsoto commented on Jul 22, 2026

    @dalexsoto
    Member

    Retry update for #26206 @ d11712b201b1c71e823de7f46cb3c7c2ee96b292: build 14731892 reached terminal state with only the monotouch_ios app timeouts remaining. simulator_tests attempt 3 was accepted to rerun that job and is pending.

    Reconciled budget: 3 lifetime / 2 current-head requests.

  15. dalexsoto commented on Jul 23, 2026

    @dalexsoto
    Member

    Final retry outcome for merged #26206 @ d11712b201b1c71e823de7f46cb3c7c2ee96b292: build 14731892 attempt 3 — monotouch_ios again failed with LaunchTimedOut, this time in the Debug interpreter configuration on AcesShared 4.

    This adds 1 newly confirmed failure record on the already-listed PR. The TestSummary was retained; the detailed HtmlReport could not be downloaded because ArtifactTool authentication failed.

    No further retry is possible: the PR merged and refs/pull/26206/merge is no longer available. Final reconciled budget usage is 3 lifetime / 2 current-head requests.

  16. dalexsoto commented on Sep 4, 2026

    @dalexsoto
    Member

    New LaunchTimedOut occurrence on PR #26568 at head 67aab2ec04375423dd744056378cdcec459ab629:

  17. dalexsoto commented on Sep 4, 2026

    @dalexsoto
    Member

    Replacement outcome for PR #26568:

    • New head: 4237a344488a1ab2c7cee633ec9b95fa8e9f7afb.
    • Build 15218580 — T: linker_ios completed successfully at 2026-09-04T21:10:46Z.
    • The prior link sdk/iOS - simulator/Debug LaunchTimedOut from build 15216841 did not recur.
    • No manual retry was submitted; this was the automatically triggered CI run for the Xtro source-fix head.
    • The durable count remains 3 confirmed records across 2 monitored PRs.
    • Issue-specific checklist: none; the issue body has no Additional info to collect section.
  18. dalexsoto commented on Sep 5, 2026

    @dalexsoto
    Member

    New LaunchTimedOut occurrence on PR #26568 at head b06e22cade15faec3ab8b86dd82d8c911ea9a55a:

    • Build 15222573, attempt 3, T: monotouch_ios, Release compat inline Class.GetHandle.
    • The iPhone 14 / iOS 27.0 simulator booted, the app installed, and simctl launch returned PID 72596, but the app never connected to the XHarness listener within three minutes. Stdout and stderr remained empty; cancellation ended mlaunch with exit 137.
    • Classification: exact genuinely flaky simulator launch signature. Reconciled count: 4 confirmed records across 2 monitored PRs.
    • The same job also had an NSUrlSession stall tracked by [CI] iOS 27 monotouch-test stalls in NSUrlSession redirect tests with simulator daemon crash loops #26221. Azure accepted simulator_tests attempt 4 for the failed monotouch_ios job.
    • Retry usage is now 5/25 PR lifetime and 3/10 for this head.
    • Issue-specific checklist: none; the issue body has no Additional info to collect section.
  19. dalexsoto commented on Sep 5, 2026

    @dalexsoto
    Member

    Terminal retry outcome for PR #26568 at head b06e22cade15faec3ab8b86dd82d8c911ea9a55a:

    • Build 15222573, T: monotouch_ios attempt 4 completed successfully on AcesShared 1 at 2026-09-05T12:53:07Z; the simulator_tests phase completed successfully at 12:53:21Z.
    • The retry cleared the attempt-3 Release compat inline Class.GetHandle LaunchTimedOut; the same prior job also contained an NSUrlSession stall tracked by [CI] iOS 27 monotouch-test stalls in NSUrlSession redirect tests with simulator daemon crash loops #26221. No new failure occurrence was recorded. The parent Azure run was still finalizing publication work at the last refresh.
    • Reconciled count remains 4 confirmed records across 2 monitored PRs.
    • Retry usage remains 5/25 PR lifetime and 3/10 for this head.
    • Issue-specific checklist: none; the issue body has no Additional info to collect section.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    ci-postmortemcopilot

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions