Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running all tests with debugger using launch.json fails #2082

Closed
marcio-alves-deel opened this issue Oct 30, 2019 · 7 comments
Closed

Running all tests with debugger using launch.json fails #2082

marcio-alves-deel opened this issue Oct 30, 2019 · 7 comments
Labels
in debugger Relates to the debug adapter or process of launching a debug session in flutter Relates to running Flutter apps in testing Relates to test execution of Dart/Flutter tests for end users is bug
Milestone

Comments

@marcio-alves-deel
Copy link

marcio-alves-deel commented Oct 30, 2019

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

@DanTup
Copy link
Member

DanTup commented 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!

@DanTup DanTup added the awaiting info Requires more information from the customer to progress label Oct 31, 2019
@Gperez88
Copy link

Gperez88 commented Dec 7, 2019

same issue on Mac Mojave, the issue is occasional, sometimes it happens others do not.

@DanTup
Copy link
Member

DanTup commented 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
Copy link
Member

DanTup commented 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 DanTup added in flutter Relates to running Flutter apps in testing Relates to test execution of Dart/Flutter tests for end users is bug in debugger Relates to the debug adapter or process of launching a debug session and removed awaiting info Requires more information from the customer to progress labels Jan 13, 2020
@DanTup DanTup added this to the v3.8.0 milestone Jan 13, 2020
@DanTup
Copy link
Member

DanTup commented 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
Copy link
Member

DanTup commented 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 #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.

@DanTup DanTup modified the milestones: v3.8.0, On Deck Jan 13, 2020
@DanTup DanTup changed the title Run all tests fails Running all tests with debugger using launch.json fails Jan 13, 2020
@DanTup
Copy link
Member

DanTup commented 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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in debugger Relates to the debug adapter or process of launching a debug session in flutter Relates to running Flutter apps in testing Relates to test execution of Dart/Flutter tests for end users is bug
Projects
None yet
Development

No branches or pull requests

3 participants