Skip to content

Tests hang at coverage command #1423

Open

Description

@helinanever

Steps to reproduce:

dart pub get
dart pub global activate coverage
dart test --file-reporter json:$HOME/test.json --coverage coverage

Result: the command hangs

Last message in terminal:

00:24 <span style="color:#859900">+140</span>: All tests passed!

Happens with preview release (^2.12) with latest published versions of Dart packages on Flutter channels dev, beta and master, e.g. https://github.com/dart-lang/glob/tree/1.2.0

Full command output
log.txt

Activity

  1. mit-mit commented on Feb 3, 2021

    @mit-mit
    Member
  2. helinanever commented on Mar 10, 2021

    @helinanever
    Author

    @mit-mit This is still an issue. Many pub.green builds time out due to this (e.g. around 200 builds tested with Flutter 2.0.1).

  3. jakemac53 commented on Mar 10, 2021

    @jakemac53
    Contributor

    I can't repro this for vm tests but I can repro it for web tests (tried in the glob package), cc @grouma

  4. grouma commented on Mar 11, 2021

    @grouma
    Member

    I dug into this today. I found a fix but I don't know why. Basically coverage works to completion but the test process doesn't always exit. Note testing and coverage collection always works but just exiting is flaky. This is resolved if we add a force: true here. We probably didn't catch this in CI because we force exit due to similar issues here.

    cc @natebosch for thoughts on what's going on

  5. traveling-developer commented on Mar 18, 2021

    @traveling-developer

    @grouma this is still an issue. Using dart 2.12.2 and test 1.16.8
    If I run dart test --coverage="coverage" it never ends

  6. grouma commented on Mar 18, 2021

    @grouma
    Member

    @yudansha is it flaky or does it alway fail?

  7. reopened this on Mar 18, 2021
  8. traveling-developer commented on Mar 18, 2021

    @traveling-developer

    @grouma for me it always hangs after all tests were run and does not end.
    Both on my dev machine and on the build runner (using the google dart docker image).

  9. grouma commented on Mar 19, 2021

    @grouma
    Member

    I'm not able to reproduce this with pub run test --coverage=coverage. I am however able to reproduce this with dart test --coverage=coverage. @bkonyi can you take a look?

  10. aaronlademann-wf commented on Jun 9, 2021

    @aaronlademann-wf

    @grouma @bkonyi @jakemac53 I can also confirm that pub run build_runner test --file-reporter json:foo/test-results.json passes in certain situations for us at Workiva, while the exact same test suite hangs when running dart run build_runner test --file-reporter json:foo/test-results.json. This is on Dart 2.13.0.

    Even when it doesn't hang completely - running dart run build_runner test with a file-reporter takes 4-5 times longer than it does when not using a file-reporter, whereas pub run build_runner test with a file-reporter takes only about 2 times as long.

  11. added a commit that references this issue on Jun 9, 2021
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions