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

Unhandled exception: TimeoutException after 0:01:30.000000: Timeout while waiting for observatory debugger uri #311

Open
aminJamali opened this issue Sep 3, 2024 · 3 comments

Comments

@aminJamali
Copy link

aminJamali commented Sep 3, 2024

I have used flutter gherkin to automate my app, in short, this is my scenario:

Feature: Counter
  The counter should be incremented when the button is pressed.

  Scenario: Counter increases when the button is pressed
    When I tap the "increment" button 10 times

and this is my step definition:

class TapButtonNTimesStep extends When2WithWorld<String, int, FlutterWorld> {
  TapButtonNTimesStep()
      : super(
          StepDefinitionConfiguration()
            ..timeout = Duration(
              seconds: 10,
            ),
        );

  @override
  Future<void> executeStep(input1, input2) async {
    final locator = find.byValueKey(input1);
    for (var i = 0; i < input2; i += 1) {
      await FlutterDriverUtils.tap(world.driver, locator);
    }
    final textLocator = find.byValueKey('counter');
    expectMatch(world.driver!.getText(textLocator), input2.toString());
  }

  @override
  Pattern get pattern => r"I tap the {string} button {int} times";
}

also I have created an app.dart file that contains the void method and enables the flutterDriver:

void main() {
 
  enableFlutterDriverExtension();


  runApp(MyApp());
}

and finally, this is my app_test.dart file that configures the gherkin:

Future<void> main() {
  final config = FlutterTestConfiguration()
    ..features = [RegExp('features/*.*.feature')]
    ..reporters = [
      ProgressReporter(),
      TestRunSummaryReporter(),
    ]
    ..stepDefinitions = [
      TapButtonNTimesStep(),
    ]
    ..restartAppBetweenScenarios = true
    ..targetAppPath = "test_driver/app.dart";
  return GherkinRunner().execute(config);
}

but when I run the command flutter drive --target=test_driver/app.dart I get below error:

The Dart VM service is listening on http://127.0.0.1:53867/_Ff1HnFl60Y=/
Starting Flutter app under test 'test_driver/app.dart', this might take a few moments
You are applying Flutter's app_plugin_loader Gradle plugin imperatively using the apply script method, which is deprecated and will be removed in a future release. Migrate 
to applying Gradle plugins with the declarative plugins block: https://flutter.dev/go/flutter-gradle-plugin-apply
You are applying Flutter's main Gradle plugin imperatively using the apply script method, which is deprecated and will be removed in a future release. Migrate to applying G
radle plugins with the declarative plugins block: https://flutter.dev/go/flutter-gradle-plugin-apply
I/art     ( 5182): Debugger is no longer active
I/art     ( 5182): Starting a blocking GC Instrumentation
I/flutter ( 5275): The Dart VM service is listening on http://127.0.0.1:38142/xJ0IMG2GTyk=/
Unhandled exception:
TimeoutException after 0:01:30.000000: Timeout while waiting for observatory debugger uri

I also tried setting build time out to 10 min but didn't work.
I'm using flutter 3.22.2

@CodeRebirth
Copy link

I am facing the same issue.

@PsyOhm23
Copy link

PsyOhm23 commented Dec 4, 2024

Hi,
You could turn on the flutter process logs in your config by setting the logFlutterProcessOutput parameter to true and check for a log entry like this :
A Dart VM Service on sdk gphone64 x86 64 is available at: http://127.0.0.1:55867/T6GAbJcKORU=/
The FlutterRunProcessHandler class check for this line to extract the VM url.

@PsyOhm23
Copy link

Hi @jonsamwell !
Is it possible for you to release a version 2.0.1 based on last commits of the master branch ?
Actually there is only few commits between master and the 2.0.0 release including this fix which will close this one !
Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants