Skip to content

Bad state: Invalid DartDevelopmentServiceException JSON error from Linux_android_emu tests causing many flakes #152684

Closed

Description

@zanderso

For example from: https://ci.chromium.org/ui/p/flutter/builders/prod/Linux_android_emu%20external_textures_integration_test/2527/overview

[2024-08-01 02:41:47.004421] [STDOUT] stdout: [  +14 ms] Launching a Dart Developer Service (DDS) instance at http://127.0.0.1:0/, connecting to VM service at http://127.0.0.1:45843/hII3gND_jls=/.
[2024-08-01 02:41:48.230663] [STDOUT] stderr: 
[2024-08-01 02:41:48.230740] [STDOUT] stderr: Bad state: Invalid DartDevelopmentServiceException JSON: {error_code: 2, message: Failed to start Dart Development Service}
[2024-08-01 02:41:48.231206] [STDOUT] stderr: #0      new DartDevelopmentServiceException.fromJson (package:flutter_tools/src/base/dds.dart:144:5)

Not sure if it's related, but it looks like this started happening after the API level updated from 34 to 35 in c3fbf3d. cc @camsim99

Since it seems like the error in parsing the dds json is obscuring the actual failure, also cc @bkonyi and @andrewkolos

Activity

  1. bkonyi commented on Aug 1, 2024

    @bkonyi
    Contributor

    Looks like some bad pattern matching in the DDS exception parsing code. I should have a fix up shortly.

  2. bkonyi commented on Aug 1, 2024

    @bkonyi
    Contributor

    Fix up for review: #152685

  3. zanderso commented on Aug 1, 2024

    @zanderso
    MemberAuthor

    The parse error is fixed, but tests are still flaking on DDS failing to start.

    From https://ci.chromium.org/ui/p/flutter/builders/prod/Linux_android_emu%20android_defines_test/2794/overview

    [2024-08-01 13:28:16.838831] [STDOUT] stdout: [  +16 ms] Launching a Dart Developer Service (DDS) instance at http://127.0.0.1:0/, connecting to VM service at http://127.0.0.1:34965/THrz3rDrL_Q=/.
    [2024-08-01 13:28:17.887528] [STDOUT] stdout: [+1048 ms] Warning: Failed to start DDS: Failed to start Dart Development Service
    [2024-08-01 13:28:17.889297] [STDOUT] stderr: [        ] DDS has failed to start and there is not an existing DDS instance available to connect to. Please file an issue at https://github.com/flutter/flutter/issues with the following error message:
    [2024-08-01 13:28:17.889347] [STDOUT] stderr: 
    [2024-08-01 13:28:17.889362] [STDOUT] stderr:             Failed to start Dart Development Service.
    [2024-08-01 13:28:17.890347] [STDOUT] stdout: [   +2 ms] "flutter drive" took 117,501ms.
    [2024-08-01 13:28:17.894389] [STDOUT] stderr: 
    [2024-08-01 13:28:17.894453] [STDOUT] stderr: Bad state: Failed to start Dart Development Service
    [2024-08-01 13:28:17.894672] [STDOUT] stderr: #0      DartDevelopmentService.startDartDevelopmentService (package:flutter_tools/src/base/dds.dart:290:9)
    [2024-08-01 13:28:17.894707] [STDOUT] stderr: <asynchronous suspension>
    [2024-08-01 13:28:17.894726] [STDOUT] stderr: #1      FlutterDriverService.reuseApplication (package:flutter_tools/src/drive/drive_service.dart:220:9)
    [2024-08-01 13:28:17.894744] [STDOUT] stderr: <asynchronous suspension>
    [2024-08-01 13:28:17.894761] [STDOUT] stderr: #2      DriveCommand.runCommand (package:flutter_tools/src/commands/drive.dart:279:9)
    [2024-08-01 13:28:17.894779] [STDOUT] stderr: <asynchronous suspension>
    [2024-08-01 13:28:17.894802] [STDOUT] stderr: #3      FlutterCommand.run.<anonymous closure> (package:flutter_tools/src/runner/flutter_command.dart:1408:27)
    [2024-08-01 13:28:17.894820] [STDOUT] stderr: <asynchronous suspension>
    [2024-08-01 13:28:17.894841] [STDOUT] stderr: #4      AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:153:19)
    [2024-08-01 13:28:17.894860] [STDOUT] stderr: <asynchronous suspension>
    [2024-08-01 13:28:17.894877] [STDOUT] stderr: #5      CommandRunner.runCommand (package:args/command_runner.dart:212:13)
    [2024-08-01 13:28:17.894901] [STDOUT] stderr: <asynchronous suspension>
    [2024-08-01 13:28:17.894919] [STDOUT] stderr: #6      FlutterCommandRunner.runCommand.<anonymous closure> (package:flutter_tools/src/runner/flutter_command_runner.dart:421:9)
    [2024-08-01 13:28:17.894942] [STDOUT] stderr: <asynchronous suspension>
    [2024-08-01 13:28:17.894961] [STDOUT] stderr: #7      AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:153:19)
    [2024-08-01 13:28:17.894984] [STDOUT] stderr: <asynchronous suspension>
    [2024-08-01 13:28:17.895003] [STDOUT] stderr: #8      FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:364:5)
    [2024-08-01 13:28:17.895027] [STDOUT] stderr: <asynchronous suspension>
    [2024-08-01 13:28:17.895047] [STDOUT] stderr: #9      run.<anonymous closure>.<anonymous closure> (package:flutter_tools/runner.dart:130:9)
    [2024-08-01 13:28:17.895069] [STDOUT] stderr: <asynchronous suspension>
    [2024-08-01 13:28:17.895088] [STDOUT] stderr: #10     AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:153:19)
    [2024-08-01 13:28:17.895106] [STDOUT] stderr: <asynchronous suspension>
    [2024-08-01 13:28:17.895127] [STDOUT] stderr: #11     main (package:flutter_tools/executable.dart:93:3)
    [2024-08-01 13:28:17.895145] [STDOUT] stderr: <asynchronous suspension>
    
  4. camsim99 commented on Aug 1, 2024

    @camsim99
    Contributor

    I'm not sure what DartDevelopmentService is but I also experienced another socket/connection issue when trying to run tests on Android 35 emulators where localhost wouldn't resolves as a host for Sockets:

    java.lang.RuntimeException: java.net.UnknownHostException: Unable to resolve host "localhost": No address associated with hostname
          at dev.flutter.scenariosui.ScreenshotUtil.lambda$onCreate$0(ScreenshotUtil.java:73)
          at dev.flutter.scenariosui.ScreenshotUtil$$ExternalSyntheticLambda1.run(Unknown Source:0)
    

    from https://github.com/flutter/engine/blob/30ffe6eb428b76e9a9223d7261ec0e7adece4ad6/testing/scenario_app/android/app/src/androidTest/java/dev/flutter/scenariosui/ScreenshotUtil.java#L70

    However, 127.0.0.1 does. Could that possibly be related?

  5. zanderso commented on Aug 1, 2024

    @zanderso
    MemberAuthor

    @bkonyi would you be able to help interpret the error messages above?

  6. added
    in triagePresently being triaged by the triage team
    platform-androidAndroid applications specifically
    and removed
    in triagePresently being triaged by the triage team
    on Aug 2, 2024
  7. 31 remaining items

  8. removed their assignment
    on Aug 19, 2024
  9. zanderso commented on Aug 22, 2024

    @zanderso
    MemberAuthor

    As stated, this issue has been addressed. The root cause was instability in the API Level 35 emulator, but this symptom was addressed by disabling DDS in most tests.

  10. github-actions commented on Sep 5, 2024

    @github-actions

    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.

  11. locked as resolved and limited conversation to collaborators on Sep 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1High-priority issues at the top of the work listc: flakeTests that sometimes, but not always, incorrectly passteam-androidOwned by Android platform teamtriaged-androidTriaged by Android platform team

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions