Repository navigation
flutter test does not terminate flutter_tester processes when terminated #151230
Copy link
Copy link
Closed
Labels
r: duplicateIssue is closed as a duplicate of an existing issueIssue is closed as a duplicate of an existing issue
Description
Steps to reproduce
- create a test that takes a long time to run:
import 'package:flutter_test/flutter_test.dart'; void main() { testWidgets('Counter increments smoke test', (WidgetTester tester) async { await Future.delayed(const Duration(hours: 1)); }); }
- Run the test with
flutter test - After a few seconds of running, press Ctrl+C to terminate
- Check the running process list for flutter_test processes
Expected results
Terminating the test run should also terminate flutter_tester.
Actual results
flutter_tester lives on in the background.
Code sample
Code sample
import 'package:flutter_test/flutter_test.dart';
void main() {
testWidgets('Counter increments smoke test', (WidgetTester tester) async {
await Future.delayed(const Duration(hours: 1));
});
}Screenshots or Video
Logs
Logs
flutter test test/widget_test.dart -v
... ...
[ +3 ms] test 0: Started flutter_tester process at pid 16684
[ +159 ms] test 0: connected to test device, now awaiting test result
[ ] test 0: Waiting for test harness or tests to finish
00:06 +0: Counter increments smoke test [+5629 ms] Running 2 shutdown hooks
[ ] Shutdown hooks complete
[ ] exiting with code 0
Terminate batch job (Y/N)? yFlutter Doctor output
Doctor output
PS C:\Dev\Test Projects\dartcode_5165> flutter doctor -v
[!] Flutter (Channel master, 3.23.0-14.0.pre.108, on Microsoft Windows [Version 10.0.22631.3737], locale en-GB)
• Flutter version 3.23.0-14.0.pre.108 on channel master at C:\Dev\Google\Flutter\Flutter main
! Warning: `dart` on your path resolves to C:\Dev\Tools\Dart\Stable\bin\dart.exe, which is not inside your current Flutter SDK checkout at
C:\Dev\Google\Flutter\Flutter main. Consider adding C:\Dev\Google\Flutter\Flutter main\bin to the front of your path.
• Upstream repository [email protected]:DanTup/flutter.git
• FLUTTER_GIT_URL = [email protected]:DanTup/flutter.git
• Framework revision 4cb6d38492 (15 hours ago), 2024-07-02 16:13:23 -0400
• Engine revision 4427894144
• Dart version 3.5.0 (build 3.5.0-321.0.dev)
• DevTools version 2.37.0
• If those were intentional, you can disregard the above warnings; however it is recommended to use "git" directly to perform update checks and
upgrades.
[✓] Windows Version (Installed version of Windows is version 10 or higher)
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
• Android SDK at C:\Users\danny\AppData\Local\Android\sdk
• Platform android-34, build-tools 34.0.0
• Java binary at: C:\Program Files\Android\Android Studio\jbr\bin\java
• Java version OpenJDK Runtime Environment (build 17.0.9+0--11185874)
• All Android licenses accepted.
[✓] Chrome - develop for the web
• Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe
[✓] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.7.4)
• Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Community
• Visual Studio Community 2022 version 17.7.34031.279
• Windows 10 SDK version 10.0.22621.0
[✓] Android Studio (version 2023.2)
• 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 17.0.9+0--11185874)
[✓] VS Code (version 1.90.2)
• VS Code at C:\Users\danny\AppData\Local\Programs\Microsoft VS Code
• Flutter extension version 3.93.20240702
[✓] VS Code (version 1.91.0-insider)
• VS Code at C:\Users\danny\AppData\Local\Programs\Microsoft VS Code Insiders
• Flutter extension version 3.91.20240529
[✓] Connected device (3 available)
• Windows (desktop) • windows • windows-x64 • Microsoft Windows [Version 10.0.22631.3737]
• Chrome (web) • chrome • web-javascript • Google Chrome 126.0.6478.127
• Edge (web) • edge • web-javascript • Microsoft Edge 126.0.2592.61
[✓] Network resources
• All expected network resources are available.
! Doctor found issues in 1 category.Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
r: duplicateIssue is closed as a duplicate of an existing issueIssue is closed as a duplicate of an existing issue

Activity
danagbemava-nc commentedon Jul 3, 2024
Hi @DanTup, I think this might be a duplicate of #144222.
Can you confirm if this is the case?
DanTup commentedon Jul 3, 2024
Oops yes, I think you're right. Although the earlier comments mention this only being in VS Code, apparently I commented confirming it could be reproduced without VS Code (#144222 (comment)).
I'll close this one and update the title of that one to make it a little clearer. Thanks!
github-actions commentedon Jul 17, 2024
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.