Skip to content

Commit 20197e4

Browse files
HyunwookYooclaude
andcommitted
fix(ci): retry the iOS integration tests once when flutter test hangs
With libc pinned, the ios job builds the app, but flutter test then hung without any output for 30 minutes after "Xcode build done" (run 37471113969; no test ran, the run was cancelled by hand). This is Flutter's known race in the simulator log reader: the app can print the VM service line before the log stream is attached, and the tool then waits for it forever (flutter/flutter#181771, fix proposed in #193142, not released). The issue reports it for about 3 of 40 runs on macos-26. The test step now has a 15 minute timeout and continue-on-error. A failed or hung first attempt is followed by one more attempt with a 12 minute timeout. A failure-only step prints the simulator's Runner log and the crash reports, so a hang that is not this race can be diagnosed from the log. Remove the retry once the Flutter version in use has the fix. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01G3n8VQCkYmLnMTjmfu5PUV
1 parent 0a287bd commit 20197e4

1 file changed

Lines changed: 31 additions & 0 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,37 @@ jobs:
213213
udid="$(python3 tools/ci/pick_simulator.py "$RUNNER_TEMP/sim.json")"
214214
echo "udid=$udid" >> "$GITHUB_OUTPUT"
215215
xcrun simctl bootstatus "$udid" -b
216+
# flutter test sometimes misses the VM service line in the simulator log and then waits
217+
# forever after "Xcode build done" (flutter/flutter#181771, fix proposed in #193142). The
218+
# timeout ends that hang and the next step tries once more. Drop both once Flutter has the fix.
216219
- name: Integration tests on the simulator
220+
id: tests
217221
working-directory: app
222+
timeout-minutes: 15
223+
continue-on-error: true
218224
run: flutter test integration_test/core_test.dart -d "${{ steps.sim.outputs.udid }}"
225+
- name: Integration tests on the simulator, second attempt
226+
if: steps.tests.outcome != 'success'
227+
working-directory: app
228+
timeout-minutes: 12
229+
run: |
230+
echo "::warning::The first test attempt failed or hung; trying once more (flutter/flutter#181771)."
231+
xcrun simctl terminate "${{ steps.sim.outputs.udid }}" dev.chatproject.chatapp || true
232+
flutter test integration_test/core_test.dart -d "${{ steps.sim.outputs.udid }}"
233+
- name: Simulator diagnostics
234+
if: failure()
235+
timeout-minutes: 5
236+
env:
237+
UDID: ${{ steps.sim.outputs.udid }}
238+
run: |
239+
# Best effort: nothing here may fail the step.
240+
set +e
241+
t() { perl -e 'alarm shift; exec @ARGV' "$@"; }
242+
echo "::group::Runner log inside the simulator (last 40 minutes)"
243+
t 90 xcrun simctl spawn "$UDID" log show --last 40m --style compact --predicate 'processImagePath ENDSWITH "Runner"' | tail -300
244+
echo "::endgroup::"
245+
echo "::group::Crash reports"
246+
ls -lt ~/Library/Logs/DiagnosticReports | head -10
247+
for f in $(ls -t ~/Library/Logs/DiagnosticReports/Runner* 2>/dev/null | head -2); do echo "== $f"; head -c 6000 "$f"; done
248+
echo "::endgroup::"
249+
exit 0

0 commit comments

Comments
 (0)