Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flutter drive: Cannot set timeout on GetHealth command #23857

Closed
mmcc007 opened this issue Nov 2, 2018 · 6 comments · Fixed by #24066
Closed

Flutter drive: Cannot set timeout on GetHealth command #23857

mmcc007 opened this issue Nov 2, 2018 · 6 comments · Fixed by #24066
Labels
a: tests "flutter test", flutter_test, or one of our tests waiting for PR to land (fixed) A fix is in flight

Comments

@mmcc007
Copy link

mmcc007 commented Nov 2, 2018

I am using the default counter app to set-up integration testing on TravisCI. I am running the android emulator on linux and the ios simulator on mac. The default integration test passes on mac/ios/simulator but fails on linux/android/emulator.

The android emulator is getting a timeout on the driver's GetHealth command when running on Travis (no hardware acceleration, graphics in software). The weird thing is tests from other projects are getting past this health check and completing successfully (when timeouts added where permitted). But when I run the default counter app integration test it times out on the GetHealth command.

This is the test:

void main() {
  group('end-to-end test', () {
    FlutterDriver driver;
    final timeout = Duration(seconds: 20);

    setUpAll(() async {
      // Connect to a running Flutter application instance.
      driver = await FlutterDriver.connect(
        isolateReadyTimeout: timeout,
        printCommunication: true,
      );
    });

    tearDownAll(() async {
      if (driver != null) driver.close();
    });

    test('tap on the floating action button; verify counter', () async {
      // Finds the floating action button (fab) to tap on
      SerializableFinder fab = find.byTooltip('Increment');

      // Wait for the floating action button to appear
      await driver.waitFor(fab, timeout: timeout);

      // Tap on the fab
      await driver.tap(fab, timeout: timeout);

      // Wait for text to change to the desired value
      await driver.waitFor(find.text('1'), timeout: timeout);
    });
  });
}

and the resulting timeout:

[   +2 ms]   DriverError: Failed to fulfill GetHealth: Flutter application not responding
[        ]   Original error: TimeoutException after 0:00:07.500000: Future not completed

Here is the same line in the build on travis.

I tried increasing timeouts wherever I could, but the GetHealth time out is unaffected.
Is there a way to fix this? I suspect it would pass if I could add a timeout to GetHealth, but there might be another way.

[✓] Flutter (Channel unknown, v0.9.4, on Linux, locale en_US.UTF-8)
    • Flutter version 0.9.4 at /home/travis/build/mmcc007/flutter_app/flutter
    • Framework revision f37c235c32 (5 weeks ago), 2018-09-25 17:45:40 -0400
    • Engine revision 74625aed32
    • Dart version 2.1.0-dev.5.0.flutter-a2eb050044
[✓] Android toolchain - develop for Android devices (Android SDK 25.0.2)
    • Android SDK at /opt/android-sdk-linux
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-25, build-tools 25.0.2
    • ANDROID_HOME = /opt/android-sdk-linux
    • Java binary at: /usr/lib/jvm/java-8-oracle/bin/java
    • Java version Java(TM) SE Runtime Environment (build 1.8.0_151-b12)
    • All Android licenses accepted.
[✗] Android Studio (not installed)
    • Android Studio not found; download from https://developer.android.com/studio/index.html
      (or visit https://flutter.io/setup/#android-setup for detailed instructions).
[✓] Connected devices (1 available)
    • sdk phone armv7 • emulator-5554 • android-arm • Android 5.1.1 (API 22) (emulator)
! Doctor found issues in 1 category.

Here is the complete source code:
https://github.com/mmcc007/flutter_app/tree/f2738cfd44802e51ab2d47c0824b096ab57617f8
and the build on travis showing it working on ios but failing on android:
https://travis-ci.org/mmcc007/flutter_app/builds/449653234

@zoechi zoechi added waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds a: tests "flutter test", flutter_test, or one of our tests and removed waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds labels Nov 2, 2018
@mmcc007
Copy link
Author

mmcc007 commented Nov 2, 2018

The global timeout multiplier proposed by @yjbanov in #14732 would be a good solution. This would allow developers to run their integration tests on the cloud in linux (and Mac/Windows).

That would then make it possible to automate deployment to both stores from the cloud using something like Fastlane. That would enable a very cost effective CICD solution for Flutter.

I was planning on setting up a demo of a complete CICD solution for Flutter on Travis (and maybe then on other CI vendors). Being able to manage all driver timeouts would make this possible.

@yjbanov
Copy link
Contributor

yjbanov commented Nov 7, 2018

PR is out for review #24066

@zoechi zoechi added the waiting for PR to land (fixed) A fix is in flight label Nov 8, 2018
@mmcc007
Copy link
Author

mmcc007 commented Nov 15, 2018

PR #24066 fixed the timeout issue on GetHealth. Here is the build using master on travis showing the GetHealth command succeeding. The integration test should now passing on both ios and android in cloud 🎉

@mmcc007
Copy link
Author

mmcc007 commented Nov 15, 2018

I'm now getting timeouts on ios (which I haven't seen before) even though it is succeeding on android. It may be an interim issue with master, or could be related to this fix. Not clear.
src

@mmcc007
Copy link
Author

mmcc007 commented Nov 19, 2018

Everything is working fine now on beta v0.11.7
https://travis-ci.org/mmcc007/flutter_app/builds/456715996
Thanks @yjbanov and all involved! 🎉

@github-actions
Copy link

github-actions bot commented Sep 1, 2021

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 1, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
a: tests "flutter test", flutter_test, or one of our tests waiting for PR to land (fixed) A fix is in flight
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants