You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Can't exit flutter tests when running it via dart process #98395
Here is a gif with detachedStdio which opens several terminals and thereafter runs the tests which is cancellable via ctrl + c. I mention this in case the several terminal openings is related to why it does not work with inheritStdio. Also because I don't think it should open those terminals.
env
I'm on windows 11, running that command from git bash.
Doctor summary
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 2.10.1, on Microsoft Windows [Version 10.0.22000.493], locale en-BE)
[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
[✓] Chrome - develop for the web
[✓] Visual Studio - develop for Windows (Visual Studio Build Tools 2019 16.11.10)
[✓] Android Studio (version 4.0)
[✓] VS Code, 64-bit edition (version 1.64.1)
[✓] Connected device (4 available)
[✓] HTTP Host Availability
Hi @cedvdb, thanks for filing the issue I followed your reproducible steps and I was able to exit the tests, However, I had to press enter twice on entering "y" could you confirm if this is the same case for you? or process doesn't exit at all even after pressing enter multiple times?
logs
PS C:\Users\mahesh\Desktop\flutter_repros> dart run run_me.dart
Running "flutter pub get" in flutter_repros... 641ms
Multiple devices found:
Redmi K20 Pro (mobile) • 192.168.1.2:5555 • android-arm64 • Android 11 (API 30)
sdk gphone64 x86 64 (mobile) • emulator-5554 • android-x64 • Android 12 (API 31) (emulator)
Windows (desktop) • windows • windows-x64 • Microsoft Windows [Version
10.0.19044.1466]
Chrome (web) • chrome • web-javascript • Google Chrome 98.0.4758.82
Edge (web) • edge • web-javascript • Microsoft Edge 97.0.1072.76
[1]: Redmi K20 Pro (192.168.1.2:5555)
[2]: sdk gphone64 x86 64 (emulator-5554)
[3]: Windows (windows)
[4]: Chrome (chrome)
[5]: Edge (edge)
Please choose one (To quit, press "q/Q"): 1
Warning: Mapping new ns http://schemas.android.com/repository/android/common/02 to old ns http://schemas.android.com/repository/android/common/01
Warning: Mapping new ns http://schemas.android.com/repository/android/generic/02 to old ns http://schemas.android.com/repository/android/generic/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/02 to old ns http://schemas.android.com/sdk/android/repo/addon2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/02 to old ns http://schemas.android.com/sdk/android/repo/repository2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/02 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01
Running Gradle task 'assembleDebug'... 32.3s
√ Built build\app\outputs\flutter-apk\app-debug.apk.
Installing build\app\outputs\flutter-apk\app.apk... 19.0s
Error: ADB exited with exit code 1
Performing Streamed Install
adb: failed to install
C:\Users\mahesh\Desktop\flutter_repros\build\app\outputs\flutter-apk\app.apk: Failure
[INSTALL_FAILED_UPDATE_INCOMPATIBLE: Package com.example.flutter_repros signatures do not match
previously installed version; ignoring!]
Uninstalling old version...
Installing build\app\outputs\flutter-apk\app.apk... 21.9s
Error: ADB exited with exit code 1
Performing Streamed Install
adb: failed to install
C:\Users\mahesh\Desktop\flutter_repros\build\app\outputs\flutter-apk\app.apk: Failure
[INSTALL_FAILED_USER_RESTRICTED: Install canceled by user]
PS C:\Users\mahesh\Desktop\flutter_repros> dart run run_me.dart
Running "flutter pub get" in flutter_repros... 732ms
Multiple devices found:
Redmi K20 Pro (mobile) • 192.168.1.2:5555 • android-arm64 • Android 11 (API 30)
sdk gphone64 x86 64 (mobile) • emulator-5554 • android-x64 • Android 12 (API 31) (emulator)
Windows (desktop) • windows • windows-x64 • Microsoft Windows [Version
10.0.19044.1466]
Chrome (web) • chrome • web-javascript • Google Chrome 98.0.4758.82
Edge (web) • edge • web-javascript • Microsoft Edge 97.0.1072.76
[1]: Redmi K20 Pro (192.168.1.2:5555)
[2]: sdk gphone64 x86 64 (emulator-5554)
[3]: Windows (windows)
[4]: Chrome (chrome)
[5]: Edge (edge)
Please choose one (To quit, press "q/Q"): 1
Warning: Mapping new ns http://schemas.android.com/repository/android/common/02 to old ns http://schemas.android.com/repository/android/common/01
Warning: Mapping new ns http://schemas.android.com/repository/android/generic/02 to old ns http://schemas.android.com/repository/android/generic/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/02 to old ns http://schemas.android.com/sdk/android/repo/addon2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/02 to old ns http://schemas.android.com/sdk/android/repo/repository2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/02 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01
Running Gradle task 'assembleDebug'... 15.7s
√ Built build\app\outputs\flutter-apk\app-debug.apk.
Installing build\app\outputs\flutter-apk\app.apk... 16.0s
Error: ADB exited with exit code 1
Performing Streamed Install
adb: failed to install
C:\Users\mahesh\Desktop\flutter_repros\build\app\outputs\flutter-apk\app.apk: Failure
[INSTALL_FAILED_UPDATE_INCOMPATIBLE: Package com.example.flutter_repros signatures do not match
previously installed version; ignoring!]
Uninstalling old version...
Installing build\app\outputs\flutter-apk\app.apk... 20.5s
VMServiceFlutterDriver: Connecting to Flutter application at http://127.0.0.1:63554/2bxuxiertnk=/
VMServiceFlutterDriver: Isolate found with number: 923730394982763
VMServiceFlutterDriver: Isolate is paused at start.
VMServiceFlutterDriver: Attempting to resume isolate
I/flutter (30698): 00:00 +0: end-to-end test tap on the floating action button, verify counter
VMServiceFlutterDriver: Connected to Flutter application.
I/.flutter_repro(30698): ProcessProfilingInfo new_methods=964 is saved saved_to_disk=1
resolve_classes_delay=8000
^CTerminate batch job (Y/N)? Terminate batch job (Y/N)? y
Terminate batch job (Y/N)?
PS C:\Users\mahesh\Desktop\flutter_repros>
flutter doctor -v
[√] Flutter (Channel stable, 2.10.1, on Microsoft Windows [Version 10.0.19044.1466], locale en-US)
• Flutter version 2.10.1 at C:\flutter_sdk\stable
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision db747aa133 (5 days ago), 2022-02-09 13:57:35 -0600
• Engine revision ab46186b24
• Dart version 2.16.1
• DevTools version 2.9.2
[√] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
• Android SDK at C:\Users\mahesh\AppData\Local\Android\sdk
• Platform android-31, build-tools 31.0.0
• Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)
• All Android licenses accepted.
[√] Chrome - develop for the web
• Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe
[√] Visual Studio - develop for Windows (Visual Studio Community 2019 16.11.4)
• Visual Studio at C:\Program Files (x86)\Microsoft Visual Studio\2019\Community
• Visual Studio Community 2019 version 16.11.31727.386
• Windows 10 SDK version 10.0.19041.0
[√] Android Studio (version 2020.3)
• Android Studio at C:\Program Files\Android\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 11.0.10+0-b96-7249189)
[√] VS Code (version 1.63.2)
• VS Code at C:\Users\mahesh\AppData\Local\Programs\Microsoft VS Code
• Flutter extension version 3.34.0
[√] Connected device (5 available)
• Redmi K20 Pro (mobile) • 192.168.1.2:5555 • android-arm64 • Android 11 (API 30)
• sdk gphone64 x86 64 (mobile) • emulator-5554 • android-x64 • Android 12 (API 31) (emulator)
• Windows (desktop) • windows • windows-x64 • Microsoft Windows [Version 10.0.19044.1466]
• Chrome (web) • chrome • web-javascript • Google Chrome 98.0.4758.82
• Edge (web) • edge • web-javascript • Microsoft Edge 97.0.1072.76
[√] HTTP Host Availability
• All required HTTP hosts are available
• No issues found!
Apperently it exits when pressing Y twice on my end too. However this is just a small reproduction of an issue I'm having. In the real scenario I cannot get out of the terminal at all. Since this small repro exhibits some odd behavior, my guess is that solving those oddities will also solve the issues I have in the real project.
The two oddities are:
when the process is launched with ProcessStartMode.inheritStdio , you have to press Y twice to get out of the process.
when the process is launched with ProcessStartMode.detached, multiple terminals are open.
Those may, or may not stem from the same issue, but I've a feeling it is. If you change in my repro ProcessStartMode.inheritStdio to ProcessStartMode.detached you will see multiple terminals opening as I have posted in the gif above.
However this is just a small reproduction of an issue I'm having. In the real scenario I cannot get out of the terminal at all. Since this small repro exhibits some odd behavior, my guess is that solving those oddities will also solve the issues I have in the real project.
Thanks for the info @cedvdb, This is the output I get when running in ProcessStartMode.inheritStdio I have to submit y twice to exit the dart process.
And Incase of ProcessStartMode.detached, I see several command prompts launching and getting killed and then there's one cmd where the tests start running and on pressing ctrl +c the window closes
2022-02-15.12-34-12_Trim.mp4flutter doctor -v
[√] Flutter (Channel stable, 2.10.1, on Microsoft Windows [Version 10.0.19044.1466], locale
en-US)
• Flutter version 2.10.1 at C:\flutter_sdk\stable
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision db747aa133 (5 days ago), 2022-02-09 13:57:35 -0600
• Engine revision ab46186b24
• Dart version 2.16.1
• DevTools version 2.9.2
[√] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
• Android SDK at C:\Users\mahesh\AppData\Local\Android\sdk
• Platform android-31, build-tools 31.0.0
• Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)
• All Android licenses accepted.
[√] Chrome - develop for the web
• Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe
[√] Visual Studio - develop for Windows (Visual Studio Community 2019 16.11.4)
• Visual Studio at C:\Program Files (x86)\Microsoft Visual Studio\2019\Community
• Visual Studio Community 2019 version 16.11.31727.386
• Windows 10 SDK version 10.0.19041.0
[√] Android Studio (version 2020.3)
• Android Studio at C:\Program Files\Android\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 11.0.10+0-b96-7249189)
[√] VS Code (version 1.63.2)
• VS Code at C:\Users\mahesh\AppData\Local\Programs\Microsoft VS Code
• Flutter extension version 3.34.0
[√] Connected device (5 available)
• Redmi K20 Pro (mobile) • 192.168.1.2:5555 • android-arm64 • Android 11 (API 30)
• sdk gphone64 x86 64 (mobile) • emulator-5554 • android-x64 • Android 12 (API 31)
(emulator)
• Windows (desktop) • windows • windows-x64 • Microsoft Windows [Version 10.0.19044.1466]
• Chrome (web) • chrome • web-javascript • Google Chrome 98.0.4758.82 • Edge (web) • edge • web-javascript • Microsoft Edge
97.0.1072.76
[√] HTTP Host Availability
• All required HTTP hosts are available
• No issues found!
[√] Flutter (Channel master, 2.11.0-0.0.pre.554, on Microsoft Windows [Version 10.0.19044.1526],
locale en-US)
• Flutter version 2.11.0-0.0.pre.554 at C:\flutter_sdk\master
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 894ef49c7c (4 hours ago), 2022-02-14 22:15:17 -0500
• Engine revision 8714a2448f
• Dart version 2.17.0 (build 2.17.0-105.0.dev)
• DevTools version 2.10.0
[√] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
• Android SDK at C:\Users\mahesh\AppData\Local\Android\sdk
• Platform android-31, build-tools 31.0.0
• Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)
• All Android licenses accepted.
[√] Chrome - develop for the web
• Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe
[√] Visual Studio - develop for Windows (Visual Studio Community 2019 16.11.4)
• Visual Studio at C:\Program Files (x86)\Microsoft Visual Studio\2019\Community
• Visual Studio Community 2019 version 16.11.31727.386
• Windows 10 SDK version 10.0.19041.0
[√] Android Studio (version 2020.3)
• Android Studio at C:\Program Files\Android\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 11.0.10+0-b96-7249189)
[√] VS Code (version 1.63.2)
• VS Code at C:\Users\mahesh\AppData\Local\Programs\Microsoft VS Code
• Flutter extension version 3.34.0
[√] Connected device (5 available)
• sdk gphone x86 (mobile) • emulator-5554 • android-x86 • Android 11 (API 30) (emulator)
• Windows (desktop) • windows • windows-x64 • Microsoft Windows [Version
10.0.19044.1526]
• Windows (UWP) (desktop) • winuwp • windows-uwp-x64 •
• Chrome (web) • chrome • web-javascript • Google Chrome 98.0.4758.102
• Edge (web) • edge • web-javascript • Microsoft Edge 97.0.1072.76
[√] HTTP Host Availability
• All required HTTP hosts are available
• No issues found!
This is actually blocking here is my use case, I'm trying to create a flutter_cli to accomplish various tasks ranging from icon creation, to running tests:
In this gif pressing ctrl + c does nothing.
The inability to exit the tests renders the cli unusable, especially for integration tests which can take a long time to run.. The goal being to make this public eventually.
I believe this was fixed by #99871. Upgrading your Flutter SDK to any commit past that fix should resolve this (the fix was just updating the bash script to use exec)
I just tested this from latest master and the issue persists ( I still cannot quit the test early ) but I'm inclined to think this is an issue with dart since this happens with tools other than flutter too.
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.
Activity
maheshj01 commentedon Feb 14, 2022
Hi @cedvdb, thanks for filing the issue I followed your reproducible steps and I was able to exit the tests, However, I had to press enter twice on entering "y" could you confirm if this is the same case for you? or process doesn't exit at all even after pressing enter multiple times?
logs
flutter doctor -v
cedvdb commentedon Feb 14, 2022
Apperently it exits when pressing Y twice on my end too. However this is just a small reproduction of an issue I'm having. In the real scenario I cannot get out of the terminal at all. Since this small repro exhibits some odd behavior, my guess is that solving those oddities will also solve the issues I have in the real project.
The two oddities are:
ProcessStartMode.inheritStdio, you have to press Y twice to get out of the process.ProcessStartMode.detached, multiple terminals are open.Those may, or may not stem from the same issue, but I've a feeling it is. If you change in my repro
ProcessStartMode.inheritStdiotoProcessStartMode.detachedyou will see multiple terminals opening as I have posted in the gif above.maheshj01 commentedon Feb 15, 2022
Thanks for the info @cedvdb, This is the output I get when running in
ProcessStartMode.inheritStdioI have to submit y twice to exit the dart process.run_me.dart.-.flutter_repros.-.Visual.Studio.Code.2022-02-15.12-20-14_Trim.mp4
And Incase of
ProcessStartMode.detached, I see several command prompts launching and getting killed and then there's one cmd where the tests start running and on pressing ctrl +c the window closes2022-02-15.12-34-12_Trim.mp4
flutter doctor -v
cedvdb commentedon Feb 28, 2022
This is actually blocking here is my use case, I'm trying to create a flutter_cli to accomplish various tasks ranging from icon creation, to running tests:
In this gif pressing ctrl + c does nothing.
The inability to exit the tests renders the cli unusable, especially for integration tests which can take a long time to run.. The goal being to make this public eventually.
christopherfujino commentedon Mar 15, 2022
I believe this was fixed by #99871. Upgrading your Flutter SDK to any commit past that fix should resolve this (the fix was just updating the bash script to use
exec)cedvdb commentedon Mar 24, 2022
I just tested this from latest master and the issue persists ( I still cannot quit the test early ) but I'm inclined to think this is an issue with dart since this happens with tools other than flutter too.
github-actions commentedon Apr 7, 2022
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 -vand a minimal reproduction of the issue.