question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Running all tests with debugger using launch.json fails

See original GitHub issue

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

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:2
  • Comments:7 (6 by maintainers)

github_iconTop GitHub Comments

4reactions
DanTupcommented, Jan 13, 2020

As a workaround, if you add "noDebug": true to 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).

0reactions
DanTupcommented, Jan 13, 2020

Ok, I can only repro this using launch.json and not with the Run All Tests command. The reason for this is that Run All Tests runs without the debugger, but setting up launch.json as as described at https://github.com/Dart-Code/Dart-Code/issues/1673#issuecomment-573334259 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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Could not load unit test config from launch.json as it is missing ...
The reason you see this error is because you can configure debugging tests using launch.json, so one of the things we do is...
Read more >
Debugging in Visual Studio Code
To run or debug a simple app in VS Code, select Run and Debug on the Debug start view or press F5 and...
Read more >
Run and Debug unit tests with flags - Stack Overflow
So you need to create a file at .vscode/launch.json as instructed here and add the following line to the file: "buildFlags": " ...
Read more >
VS Code Debugger not working for python - Microsoft Q&A
It seems when I do Run->"start Debugging' no command comes to terminal. Any VS Code log file that I can look at to...
Read more >
Troubleshooting - Jest
Tests are Failing and You Don't Know Why​. Try using the debugging support built into Node. Place a debugger; statement in any of...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found