Skip to content

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

Closed

Description

@marcio-w-alves

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

Activity

  1. DanTup commented on Oct 31, 2019

    @DanTup
    Member

    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!

  2. added
    awaiting infoRequires more information from the customer to progress
    on Oct 31, 2019
  3. Gperez88 commented on Dec 7, 2019

    @Gperez88

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

  4. DanTup commented on Dec 7, 2019

    @DanTup
    Member

    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!

  5. DanTup commented on Dec 9, 2019

    @DanTup
    Member

    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.

  6. added
    in flutterRelates to running Flutter apps
    in testingRelates to test execution of Dart/Flutter tests for end users
    in debuggingRelates to the debug adapter or process of running debug sessions
    and removed
    awaiting infoRequires more information from the customer to progress
    on Jan 13, 2020
  7. added this to the v3.8.0 milestone on Jan 13, 2020
  8. DanTup commented on Jan 13, 2020

    @DanTup
    Member

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

  9. DanTup commented on Jan 13, 2020

    @DanTup
    Member

    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.

  10. modified the milestones: v3.8.0, On Deck on Jan 13, 2020
  11. changed the title [-]Run all tests fails[/-] [+]Running all tests with debugger using launch.json fails[/+] on Jan 13, 2020
  12. DanTup commented on Jan 13, 2020

    @DanTup
    Member

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

  13. modified the milestones: On Deck, v3.12.0 on May 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    in debuggingRelates to the debug adapter or process of running debug sessionsin flutterRelates to running Flutter appsin testingRelates to test execution of Dart/Flutter tests for end usersis bug

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions