Repository navigation
Running all tests with debugger using launch.json fails #2082
Copy link
Copy link
Closed
Labels
in debuggingRelates to the debug adapter or process of running debug sessionsRelates to the debug adapter or process of running debug sessionsin flutterRelates to running Flutter appsRelates to running Flutter appsin testingRelates to test execution of Dart/Flutter tests for end usersRelates to test execution of Dart/Flutter tests for end usersis bug
Milestone
Description
When run-in "Run All Tests" on VSCODE to a flutter project, it is failing with the error
Shell subprocess terminated by ^C (SIGINT, -2) before connecting to test harness.
dart:async/stream_controller.dart 595:43 _StreamController.addError
dart:async/stream_controller.dart 862:13 _StreamSinkWrapper.addError
package:stream_channel/src/guarantee_channel.dart 144:14 _GuaranteeSink._addError
package:stream_channel/src/guarantee_channel.dart 135:5 _GuaranteeSink.addError
package:flutter_tools/src/test/flutter_platform.dart 566:27 FlutterPlatform._startTest
===== asynchronous gap ===========================
dart:async/zone.dart 1053:19 _CustomZone.registerUnaryCallback
dart:async-patch/async_patch.dart 71:23 _asyncThenWrapperHelper
package:flutter_tools/src/test/flutter_platform.dart FlutterPlatform._startTest
package:flutter_tools/src/test/flutter_platform.dart 368:36 FlutterPlatform.loadChannel
package:flutter_tools/src/test/flutter_platform.dart 321:46 FlutterPlatform.load
===== asynchronous gap ===========================
dart:async/zone.dart 1053:19 _CustomZone.registerUnaryCallback
dart:async-patch/async_patch.dart 71:23 _asyncThenWrapperHelper
package:test_core/src/runner/loader.dart Loader.loadFile.<fn>
package:test_core/src/runner/load_suite.dart 98:31 new LoadSuite.<fn>.<fn>
===== asynchronous gap ===========================
dart:async/zone.dart 1045:19 _CustomZone.registerCallback
dart:async/zone.dart 962:22 _CustomZone.bindCallbackGuarded
dart:async/timer.dart 52:45 new Timer
dart:async/timer.dart 89:9 Timer.run
dart:async/future.dart 172:11 new Future
package:test_api/src/backend/invoker.dart 399:21 Invoker._onRun.<fn>.<fn>.<fn>
Otherwise if I go one by one it is running all good
OS: MacOS Catalina
Flutter & Dart: 3.5.1
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
in debuggingRelates to the debug adapter or process of running debug sessionsRelates to the debug adapter or process of running debug sessionsin flutterRelates to running Flutter appsRelates to running Flutter appsin testingRelates to test execution of Dart/Flutter tests for end usersRelates to test execution of Dart/Flutter tests for end usersis bug
Activity
DanTup commentedon Oct 31, 2019
I don't see this - though I'm not on Catalina yet.
Does this reproduce for you on a new project created with the Flutter: New Project? If not, can you share a repro project that does crash?
If it does happen there, could you capture a log by running the Dart: Capture Logs command, ticking Flutter Test and Observatory (Debugger), then reproducing the issue - then stop the logging (from the notification) and attach the log here.
Thanks!
Gperez88 commentedon Dec 7, 2019
same issue on Mac Mojave, the issue is occasional, sometimes it happens others do not.
DanTup commentedon Dec 7, 2019
If you can capture a log, that may help track this down. If it doesn't happen enough to be easy to log when it does, you can enable flutter test and debugger logs to record all the time, then grab a copy when of them when you next see it (the files will be overwritten on each run). Thanks!
DanTup commentedon Dec 9, 2019
Oh, when setting log files for this, you may want to include
${name}in the log file name (see https://dartcode.org/releases/v3-7/#other-improvements) since "Run All Tests" runs each suite concurrently so if there are multiple you'll want them to write separate log files.DanTup commentedon Jan 13, 2020
This came up in #1673 (comment) and I was able to repro (once, at least - subsequent runs worked - I think there may be a race).
DanTup commentedon Jan 13, 2020
Ok, I can only repro this using
launch.jsonand not with theRun All Testscommand. The reason for this is thatRun All Testsruns without the debugger, but setting up launch.json as as described at #1673 (comment) will run in debug mode, but in a single debug session (and that fails due to multiple VM services).I don't think there's going to be an easy way to handle this.
[-]Run all tests fails[/-][+]Running all tests with debugger using launch.json fails[/+]DanTup commentedon Jan 13, 2020
As a workaround, if you add
"noDebug": trueto the launch.json, it should fix it (albeit at the expense of debugging, and a warning from VS Code that it's not a valid option).