Repository navigation
Description
Steps to reproduce
- Run
flutter create . - Following instructions from https://docs.flutter.dev/testing/integration-tests
- Setup a GitHub Action that runs iOS Flutter integration tests
- 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
- https://github.com/nilsreichardt/integration_test_problem/actions/runs/21648514800/job/62406705414
- https://github.com/nilsreichardt/integration_test_problem/actions/runs/21666884714/job/62464534109
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 \
--verboseLogs
[ +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.
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
puneetkukreja98 commentedon Feb 5, 2026
@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 caWork 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' = stableUpdated the logs for further investigation.
bkonyi commentedon Feb 12, 2026
@vashworth it looks like there's possibly a race condition in
_IOSSimulatorLogReaderthat could cause us to miss the VM service URI in the logs.The
_linesControllerinitialization is being passed in anasyncmethod for itsonListencallback, whenStreamController.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
onListento start processing the output of the log reader process and have a separate async initialization method to actually start the log reader.vashworth commentedon Feb 12, 2026
Thanks for the pointers @bkonyi!
vashworth commentedon Feb 12, 2026
We likely need to fix for
IOSDeviceLogReadertoo:flutter/packages/flutter_tools/lib/src/ios/devices.dart
Line 1556 in 2ad0bb8
7 remaining items
fix(ci): start the apps on devices with adb and simctl instead of flu…
ci: run the iOS integration tests through XCTest (flutter/flutter#181771
Merge pull request #16 from noeGnh/ci/ios-xctest
fix(ci): retry the iOS integration tests once when flutter test hangs
ci: try the iOS integration tests up to three times (flutter#181771)
ci: verbose iOS integration test attempts to locate the simulator hang
CI: iOS device job with a watchdog for flutter/flutter#181771
[flutter_tools] Wait for iOS simulator log stream before launch (flut…
[CI] iOS lane Xcode 빌드 캐시와 시뮬레이터 VM service 연결 멈춤 수정 (#493)
CI: Flutter's fix for its tool hanging on a simulator, fitted to 3.47.2
ci(ios): run simulator integration tests through xctest
github-actions commentedon Oct 29, 2026
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 -vand a minimal reproduction of the issue.[flutter_tools] Wait for iOS simulator log stream before launch (flut…