Skip to content

flutter test (Integration Tests) on iOS simulator sometimes never starts test execution after build #181771

Closed

Description

@nilsreichardt

Steps to reproduce

  1. Run flutter create .
  2. Following instructions from https://docs.flutter.dev/testing/integration-tests
  3. Setup a GitHub Action that runs iOS Flutter integration tests
  4. Run the GitHub Actions 20 or more times.

Expected results

After the Xcode build completes, the integration test should reliably start, connect to the VM service, execute the test cases, and either pass or fail with logs. The process should terminate normally.

Actual results

Intermittently, after "Xcode build done" (XCode build takes around 15 minutes), the flutter test process produces no further output and appears to hang indefinitely. No test logs are printed, and the CI job eventually times out at the GitHub Actions job limit (60 minutes). The same workflow and code succeed in other runs without changes.

Running pod install...                                      2s
Running Xcode build...                                          
Xcode build done.                                           84.2s
Error: The operation was canceled.

This happend 3x out of 40 runs. See

Code sample

This is the repository that followed the "Steps to reproduce": https://github.com/nilsreichardt/integration_test_problem

GitHub Actions workflow (20 runs per commit)
name: integration-tests-app-ci

on:
  push:

permissions: {}

jobs:
  ios-integration-test:
    runs-on: macos-26
    timeout-minutes: 30
    strategy:
        fail-fast: false
        matrix:
            # 20 runs
            parameter1: [1,2,3,4,5,6,7,8,9,10]
            parameter2: [1,2]
    steps:
      - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8

      - name: Set Flutter version from FVM config file to environment variables
        id: fvm-config-action
        uses: kuhnroyal/flutter-fvm-config-action@fcdb62b682dade6f0d9e0c6eae6acc647ca8c31d

      - uses: subosito/flutter-action@fd55f4c5af5b953cc57a2be44cb082c8f6635e8e
        with:
          flutter-version: ${{ steps.fvm-config-action.outputs.FLUTTER_VERSION }}
          channel: ${{ steps.fvm-config-action.outputs.FLUTTER_CHANNEL }}

      - uses: futureware-tech/simulator-action@6a2cef2c27540a25595e53c969fd85988700d451
        id: simulator
        with:
          wait_for_boot: true
          model: "iPhone 17"
          boot_retries: "3"
          boot_timeout_seconds: "300"

      - name: Run integration tests
        env:
          SIMULATOR_UDID: ${{ steps.simulator.outputs.udid }}
        # We use --ignore-timeouts to avoid the 12 minute timeout during the
        # build. Flutter has a timeout of 12 minutes for the build, but building
        # our iOS app takes longer. Using --ignore-timeouts is the current
        # recommended workaround, see
        # https://github.com/flutter/flutter/issues/105913#issuecomment-2770877374
        run: |
          flutter test integration_test/app_test.dart \
            -d $SIMULATOR_UDID \
            --ignore-timeouts \
            --verbose

Logs

[  +22 ms] executing: /usr/bin/arch -arm64e xcrun simctl launch 39E3AD27-11FF-4669-A561-E9AA11474751 com.example.integrationTestProblem --enable-dart-profiling --disable-vm-service-publication --enable-checked-mode --verify-entry-points
[ +120 ms] executing: /usr/bin/arch -arm64e xcrun simctl spawn 39E3AD27-11FF-4669-A561-E9AA11474751 log stream --style json --predicate eventType = logEvent AND processImagePath ENDSWITH "Runner" AND (senderImagePath ENDSWITH "/Flutter" OR senderImagePath ENDSWITH "/libswiftCore.dylib" OR processImageUUID == senderImageUUID) AND NOT(eventMessage CONTAINS ": could not find icon for representation -> com.apple.") AND NOT(eventMessage BEGINSWITH "assertion failed: ") AND NOT(eventMessage CONTAINS " libxpc.dylib ")
[+21968 ms] com.example.integrationTestProblem: 6285
[   +3 ms] Waiting for VM Service port to be available...
Error: The operation was canceled.

Full logs with --verbose: https://firebasestorage.googleapis.com/v0/b/nilsreichardt.appspot.com/o/exchange%2Fgithub%2Fintegration_test_logs.txt?alt=media&token=cd9fbfef-2488-40d9-893d-c795fcdaca67

Flutter Doctor output

2026-02-03T21:27:46.3451190Z SET ENV 'FLUTTER_VERSION' = 3.38.8
2026-02-03T21:27:46.3484090Z SET ENV 'FLUTTER_CHANNEL' = stable
2026-02-03T21:27:46.3924310Z ##[group]Run subosito/flutter-action@fd55f4c5af5b953cc57a2be44cb082c8f6635e8e
2026-02-03T21:27:46.3924710Z with:
2026-02-03T21:27:46.3924850Z   flutter-version: 3.38.8
2026-02-03T21:27:46.3925020Z   channel: stable
2026-02-03T21:27:46.3925170Z   architecture: ARM64
2026-02-03T21:27:46.3925330Z   cache: false
2026-02-03T21:27:46.3925510Z   pub-cache-path: default
2026-02-03T21:27:46.3925670Z   dry-run: false
2026-02-03T21:27:46.3925930Z   git-source: https://github.com/flutter/flutter.git
2026-02-03T21:27:46.3926160Z env:
2026-02-03T21:27:46.3926280Z   FLUTTER_VERSION: 3.38.8
2026-02-03T21:27:46.3926440Z   FLUTTER_CHANNEL: stable

Activity

  1. puneetkukreja98 commented on Feb 5, 2026

    @puneetkukreja98
    Contributor

    @nilsreichardt thanks for reporting the issue.
    I tested this on my fork. I ran a matrix of 20 jobs.

    Result - Out of 20 runs 2 jobs failed, with exact same reported above.

    Logs
    [ +66 ms] executing: /usr/bin/arch -arm64e xcrun simctl spawn 7098699A-96A9-4263-97C0-14C523AB3A39 log stream --style json --predicate eventType = logEvent AND processImagePath ENDSWITH "Runner" AND (senderImagePath ENDSWITH "/Flutter" OR senderImagePath ENDSWITH "/libswiftCore.dylib" OR processImageUUID == senderImageUUID) AND NOT(eventMessage CONTAINS ": could not find icon for representation -> com.apple.") AND NOT(eventMessage BEGINSWITH "assertion failed: ") AND NOT(eventMessage CONTAINS " libxpc.dylib ") [+2996 ms] com.example.integrationTestProblem: 12428 [ ] Waiting for VM Service port to be available... Error: The operation was ca

    Work flow url - https://github.com/puneetkukreja98/integration_test_problem/actions/runs/21714237057/job/62625569048

    Fork repo - https://github.com/puneetkukreja98/integration_test_problem

    Flutter version
    Run kuhnroyal/flutter-fvm-config-action@fcdb62b682dade6f0d9e0c6eae6acc647ca8c31d Run kuhnroyal/flutter-fvm-config-action/config@v3 Using default config from: /Users/runner/work/integration_test_problem/integration_test_problem/.fvmrc Processing file: /Users/runner/work/integration_test_problem/integration_test_problem/.fvmrc Reading default version SET ENV 'FLUTTER_VERSION' = 3.38.9 SET ENV 'FLUTTER_CHANNEL' = stable

    Updated the logs for further investigation.

  2. added
    team-toolOwned by Flutter Tool team
    platform-iosiOS applications specifically
    and removed
    in triagePresently being triaged by the triage team
    team-toolOwned by Flutter Tool team
    on Feb 5, 2026
  3. bkonyi commented on Feb 12, 2026

    @bkonyi
    Contributor

    @vashworth it looks like there's possibly a race condition in _IOSSimulatorLogReader that could cause us to miss the VM service URI in the logs.

    The _linesController initialization is being passed in an async method for its onListen callback, when StreamController.broadcast(...) expects the callbacks to be synchronous. This means we're not actually waiting for the log reader to finish initializing before launching the application on the simulator.

    We should probably only use onListen to start processing the output of the log reader process and have a separate async initialization method to actually start the log reader.

  4. added
    team-iosOwned by iOS platform team
    and removed
    team-toolOwned by Flutter Tool team
    on Feb 12, 2026
  5. vashworth commented on Feb 12, 2026

    @vashworth
    Contributor

    Thanks for the pointers @bkonyi!

  6. vashworth commented on Feb 12, 2026

    @vashworth
    Contributor

    We likely need to fix for IOSDeviceLogReader too:

    onListen: _listenToSysLog,

  7. added
    toolAffects the "flutter" command-line tool. See also t: labels.
    P2Important issues not at the top of the work list
    triaged-iosTriaged by iOS platform team
    on Feb 12, 2026
  8. 7 remaining items

  9. added a commit that references this issue on Oct 15, 2026
    c3ed85e
  10. github-actions commented on Oct 29, 2026

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  11. locked as resolved and limited conversation to collaborators on Oct 29, 2026
  12. added a commit that references this issue on Oct 29, 2026
    3ce13df
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

    P2Important issues not at the top of the work listplatform-iosiOS applications specificallyteam-iosOwned by iOS platform teamtoolAffects the "flutter" command-line tool. See also t: labels.triaged-iosTriaged by iOS platform team

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions