Skip to content

flutter drive --use-existing-app exits application (contrary to documentation) #166755

Description

@planetmarshall

Steps to reproduce

  1. Start a flutter application, and note the VM service URL
  2. Run flutter drive --driver=<some test driver> --use-existing-app=<vm_service_url>

Expected results

The test driver is executed and the application remains running. According to flutter drive --help:

--[no-]keep-app-running Will keep the Flutter application running when done testing.
By default, "flutter drive" stops the application after tests are finished, and
"--keep-app-running" overrides this. On the other hand, if "--use-existing-app" is
specified, then "flutter drive" instead defaults to leaving the application running
, and
"--no-keep-app-running" overrides it.

Actual results

The application exits.

Code sample

Use the examples in

examples/integration_test_migration/test_driver/main_test.dart

Screenshots or Video

Screenshots / Video demonstration

[Upload media here]

Logs

Logs
[Paste your logs here]

Flutter Doctor output

Doctor output
[!] Flutter (Channel [user-branch], 3.29.2, on Arch Linux 6.13.8-arch1-1, locale en_GB.UTF-8) [115ms]
    ! Flutter version 3.29.2 on channel [user-branch] at /home/andrew/projects/sky/morpho/flutter-entos/flutter
      Currently on an unknown channel. Run `flutter channel` to switch to an official channel.
      If that doesn't fix the issue, reinstall Flutter by following instructions at https://flutter.dev/setup.
    ! Upstream repository unknown source is not a standard remote.
      Set environment variable "FLUTTER_GIT_URL" to unknown source to dismiss this error.
    • Framework revision c236373904 (4 weeks ago), 2025-03-13 16:17:06 -0400
    • Engine revision 18b71d647a
    • Dart version 3.7.2
    • DevTools version 2.42.3
    • If those were intentional, you can disregard the above warnings; however it is recommended to use "git" directly to perform update checks and upgrades.

[!] Android toolchain - develop for Android devices (Android SDK version 35.0.0) [175ms]
    • Android SDK at /home/andrew/Android/Sdk
    ✗ cmdline-tools component is missing
      Run `path/to/sdkmanager --install "cmdline-tools;latest"`
      See https://developer.android.com/studio/command-line for more details.
    ✗ Android license status unknown.
      Run `flutter doctor --android-licenses` to accept the SDK licenses.
      See https://flutter.dev/to/linux-android-setup for more details.

[✓] Chrome - develop for the web [98ms]
    • CHROME_EXECUTABLE = chromium

[✓] Linux toolchain - develop for Linux desktop [198ms]
    • clang version 19.1.7
    • cmake version 4.0.0
    • ninja version 1.12.1
    • pkg-config version 2.4.3

[✓] Android Studio (version 2024.2) [96ms]
    • Android Studio at /home/andrew/.local/share/JetBrains/Toolbox/apps/android-studio
    • 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 21.0.3+-12282718-b509.11)

[✓] IntelliJ IDEA Ultimate Edition (version 2024.3) [94ms]
    • IntelliJ at /home/andrew/.local/share/JetBrains/Toolbox/apps/intellij-idea-ultimate
    • Flutter plugin version 83.0.4
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart

[✓] Connected device (2 available) [105ms]
    • Linux (desktop) • linux  • linux-x64      • Arch Linux 6.13.8-arch1-1
    • Chrome (web)    • chrome • web-javascript • Chromium 134.0.6998.165 Arch Linux

[✓] Network resources [383ms]
    • All expected network resources are available.

! Doctor found issues in 2 categories.

Metadata

Metadata

Assignees

Labels

P2Important issues not at the top of the work listfound in release: 3.29Found to occur in 3.29found in release: 3.31Found to occur in 3.31has reproducible stepsThe issue has been confirmed reproducible and is ready to work onr: fixedIssue is closed as already fixed in a newer versiont: flutter driver"flutter driver", flutter_drive, or a driver testteam-toolOwned by Flutter Tool teamtoolAffects the "flutter" command-line tool. See also t: labels.triaged-toolTriaged by Flutter Tool team

Type

No fields configured for Bug.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions