Skip to content

Integration test TimeoutException after 0:12:00.000000: Test timed out after 12 minutes #103064

@ductranit

Description

@ductranit

My app has lots of resources so it takes to to build (around 20 minutes), and I'm fine with that, but the problem is that the integration test is always failed because of Test timed out after 12 minutes error.
I wonder is there any way to disable this timeout exception?
I tried with --timeout none but it doesn't help at all.

Steps to Reproduce

  • Setup project & integration test
  • Run flutter test integration_test/app_test.dart --timeout none to deploy into real android device
  • The integration_test is building for a long time, which is normal in my case because my app has a lots of resource
  • See timeout error after 12 minutes

Expected results:
The integration_test should be run normally after 12 minutes or I need to have a way to disable this timeout

Actual results:
I got this error and the test doesn't start

12:00 +0 -1: loading /Users/admin/my_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
Code sample
@Timeout(Duration(hours: 10))
void main() {
  
  final binding = IntegrationTestWidgetsFlutterBinding.ensureInitialized()
      as IntegrationTestWidgetsFlutterBinding;

  binding.defaultTestTimeout = Timeout.none;
  print('Ready to run test');
   testWidgets('Test app flow', (WidgetTester tester) async {
      app.main();
     // my test cases
    }, timeout: Timeout.none);
}
flutter doctor -v
[✓] Flutter (Channel stable, 2.10.5, on macOS 12.3.1 21E258 darwin-arm, locale en-VN)
    • Flutter version 2.10.5 at /Users/admin/Documents/tools/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 5464c5bac7 (2 weeks ago), 2022-04-18 09:55:37 -0700
    • Engine revision 57d3bac3dd
    • Dart version 2.16.2
    • DevTools version 2.9.2

[✓] Android toolchain - develop for Android devices (Android SDK version 32.1.0-rc1)
    • Android SDK at /Users/admin/Library/Android/sdk
    • Platform android-32, build-tools 32.1.0-rc1
    • ANDROID_HOME = /Users/admin/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.11+0-b60-7772763)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 13.3)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • CocoaPods version 1.11.3

[✓] Chrome - develop for the web
    • CHROME_EXECUTABLE = /Applications/Microsoft Edge.app/Contents/MacOS/Microsoft Edge

[✓] Android Studio (version 2021.1)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.11+0-b60-7772763)

[✓] VS Code (version 1.64.0)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.40.0

[✓] VS Code (version 1.66.2)
    • VS Code at /Applications/Visual Studio Code ARM.app/Contents
    • Flutter extension version 3.40.0

[✓] Connected device (3 available)
    • duc’s iPhone (mobile) • 00008101-000318691A68001E • ios            • iOS 15.4.1 19E258
    • macOS (desktop)       • macos                     • darwin-arm64   • macOS 12.3.1 21E258 darwin-arm
    • Chrome (web)          • chrome                    • web-javascript • Microsoft Edge 101.0.1210.32

[!] HTTP Host Availability
    ✗ HTTP host https://cloud.google.com/ is not reachable. Reason: Failed to connect to https://cloud.google.com/ in seconds

! Doctor found issues in 1 category.

Metadata

Metadata

Assignees

No one assigned

    Labels

    r: invalidIssue is closed as not valid

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions