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.

Run All Test fails with SIGINT

See original GitHub issue

I’m seeing a strange issue where I can no longer execute all my tests using Dart: Run All Tests.

All tests run successfully when invoking via Visual Studio Code terminal: flutter test.

When executing Dart: Run All Tests from the command palette some tests execute, but then the process fails:

✓ Game News Item Get Contents ✓ Game News Item Get Author Shell subprocess terminated by ^C (SIGINT, -2) after tests finished. Test: /home/rich/Documents/visual_studio_code_projects/GamerNews/test/screens/news_list_test.dart Shell: /home/rich/Development/flutter/bin/cache/artifacts/engine/linux-x64/flutter_tester 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 140:14 _GuaranteeSink._addError package:stream_channel/src/guarantee_channel.dart 131:5 _GuaranteeSink.addError package:flutter_tools/src/test/flutter_platform.dart 576:29 _FlutterPlatform._startTest.<fn> ===== asynchronous gap =========================== dart:async/zone.dart 1053:19 _CustomZone.registerUnaryCallback dart:async/runtime/libasync_patch.dart 77:23 _asyncThenWrapperHelper package:flutter_tools/src/test/flutter_platform.dart _FlutterPlatform._startTest.<fn> package:flutter_tools/src/test/flutter_platform.dart 782:26 _FlutterPlatform._startTest ===== asynchronous gap =========================== dart:async/zone.dart 1053:19 _CustomZone.registerUnaryCallback dart:async/runtime/libasync_patch.dart 77:23 _asyncThenWrapperHelper package:flutter_tools/src/test/flutter_platform.dart _FlutterPlatform._startTest package:flutter_tools/src/test/flutter_platform.dart 462:36 _FlutterPlatform.loadChannel package:flutter_tools/src/test/flutter_platform.dart 417:46 _FlutterPlatform.load ===== asynchronous gap =========================== dart:async/zone.dart 1053:19 _CustomZone.registerUnaryCallback dart:async/runtime/libasync_patch.dart 77: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 87:9 Timer.run dart:async/future.dart 174:11 new Future package:test_api/src/backend/invoker.dart 399:21 Invoker._onRun.<fn>.<fn>.<fn> ✓ NewsList Screen with no news. Exited (sigint)

Sometimes, a notification pops up that says: “No Debug Adapter Found”

Flutter doctor output:

`rich@rich-GS73VR-7RF:~/Documents/visual_studio_code_projects/GamerNews$ flutter doctor Doctor summary (to see all details, run flutter doctor -v): [✓] Flutter (Channel stable, v1.2.1, on Linux, locale en_US.UTF-8) [✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3) [!] Android Studio (version 3.3) ✗ Flutter plugin not installed; this adds Flutter specific functionality. ✗ Dart plugin not installed; this adds Dart specific functionality. [✓] VS Code (version 1.33.1) [!] Connected device ! No devices available

! Doctor found issues in 2 categories.`

Capture Log output is attached.

Dart-Code-Log-2019-04-03 08-15-03.txt

The logs suggest the test process was interrupted because it couldn’t find one of the test files. But I can see that file in the editor and it does exist on the file system:

rich@rich-GS73VR-7RF:~$ ls -l /home/rich/Documents/visual_studio_code_projects/GamerNews/test/screens/game_list_test.dart -rw-r--r-- 1 rich rich 2728 Apr 30 21:05 /home/rich/Documents/visual_studio_code_projects/GamerNews/test/screens/game_list_test.dart rich@rich-GS73VR-7RF:~$

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:4
  • Comments:14 (9 by maintainers)

github_iconTop GitHub Comments

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

2reactions
jpv123commented, Jan 11, 2020

Sorry to reopen the issue, it’s happening to me in VSCode with a launch.json file configured like this:

{
        "name": "All Tests",
        "program": "test/",
        "request": "launch",
        "type": "dart",
}

Error launches

Failed to load "/Users/........../test/Widgets/ProjectCell_test.dart":
Shell subprocess terminated by ^C (SIGINT, -2) before connecting to test harness.

Running flutter test works correctly

Read more comments on GitHub >

github_iconTop Results From Across the Web

Capture SIGINT when running tests in GoLand IDE
When running from command line: go test -v -run TestSth and then calling Ctrl + C it captures fine. Example code: package main...
Read more >
run-tests.sh should exit with a failure code if any tests failed
When using run-tests.sh with Gitlab CI it doesn't know there were failures because the script always exits with at status of 0.
Read more >
unittest — Unit testing framework — Python 3.11.1 ...
This class implements the interface needed by the test runner to allow it to drive the tests, and methods that the test code...
Read more >
Check 0.15.2: 4 Advanced Features
To be certain that a test won't hang indefinitely, all tests are run with a timeout, the default being 4 seconds. If the...
Read more >
Unit test
All suites/tests in the registry may be run using a single function ... run is complete. • Each assertion tests a single logical...
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