-
Notifications
You must be signed in to change notification settings - Fork 29.8k
Description
Description
I have the exact same issue as @ductranit in #103064. I'm getting
12:00 +0 -1: loading /Users/runner/work/sharezone-app/sharezone-app/app/integration_test/app_test.dart [E]
TimeoutException after 0:12:00.000000: Test timed out after 12 minutes.
package:test_api/src/backend/invoker.dart 333:28 Invoker._handleError.<fn>
dart:async/zone.dart 1418:47 _rootRun
dart:async/zone.dart 1328:19 _CustomZone.run
package:test_api/src/backend/invoker.dart 331:10 Invoker._handleError
package:test_api/src/backend/invoker.dart 287:9 Invoker.heartbeat.<fn>.<fn>
dart:async/zone.dart 1426:13 _rootRun
dart:async/zone.dart 1328:19 _CustomZone.run
package:test_api/src/backend/invoker.dart 286:38 Invoker.heartbeat.<fn>
dart:async-patch/timer_patch.dart 18:15 Timer._createTimer.<fn>
dart:isolate-patch/timer_impl.dart 395:19 _Timer._runTimers
dart:isolate-patch/timer_impl.dart 426:5 _Timer._handleMessage
dart:isolate-patch/isolate_patch.dart 192:12 _RawReceivePortImpl._handleMessage
https://github.com/SharezoneApp/sharezone-app/runs/6866573231?check_suite_focus=true
I'm using the flutter test command. Building my app takes ~20 minutes. But the flutter test command times out after 12 minutes. So even before finish building my app, the command times out.
Using the timeout argument (flutter test --timeout none) changes nothing.
Workaround
1) Use flutter drive
My workaround is to use the flutter drive command:
flutter drive \
--driver=test_driver/integration_test.dart \
--target=integration_test/app_test.dartThe flutter drive command has no timeout. Therefore, the app finishes after ~20 minutes of building and all tests can pass.
Using v2.10.5 of Flutter.
2) Use flutter build and then flutter test
Another workaround is to run flutter build before running flutter test. Therefore, the build for flutter test should hopefully be faster because of the caching.
Edit: I have reproducible repository. It uses Flutter v3.3.4 and has cloud_firestore as a dependency to increase the build duration: https://github.com/nilsreichardt/playground/tree/integration-test-timeout
Running flutter test integration_test --timeout none on a slow machine (like CI) will fail after 12 minutes: https://github.com/nilsreichardt/playground/actions/runs/3218752730
flutter test integration_test --timeout none: https://github.com/nilsreichardt/playground/actions/runs/3218752730
flutter test integration_test --timeout 3600s: https://github.com/nilsreichardt/playground/actions/runs/3218848669
Use timeout parameter the testWidgets method: https://github.com/nilsreichardt/playground/actions/runs/3218841600
Use @Timeout(Duration(hours: 1)): https://github.com/nilsreichardt/playground/actions/runs/3218844853
Steps to reproduce (we are using Firestore to increase the build duration):
- Run these commands
flutter create integration_test_timeout
cd integration_test_timeout
flutter pub add cloud_firestore
flutter pub add firebase_core- Adjust minimum os version, for macOS: Set
platform :osx, '10.12'inmacos/Podfile - Add a basic integration
Metadata
Metadata
Assignees
Labels
Type
Projects
Status