Skip to content

Test run "hangs" at startup with invalid code #4358

Closed

Description

@DanTup
import 'package:test/test.dart';

main() {
  test('slow', () async {
    print('starting...');
    await Future<void>.delayed(const Duration(seconds: 5));
  }, timeout: const Timeout.factor(10));
}

When I try to run this code, it fails with this error:

Screenshot 2023-01-24 at 10 59 36

However, if I try to Debug it (both runs use the CodeLens on the main function), it just hangs with no error:

Screenshot 2023-01-24 at 11 00 22

Activity

  1. added
    in debuggingRelates to the debug adapter or process of running debug sessions
    in testingRelates to test execution of Dart/Flutter tests for end users
    on Jan 24, 2023
  2. added this to the v3.60.0 milestone on Jan 24, 2023
  3. DanTup commented on Jan 24, 2023

    @DanTup
    MemberAuthor

    In launch.json I had --enable-experiment=records from some testing, but it's test with "templateFor": "test" and is being passed to test. The launch is then failing with:

    Could not find an option named "enable-experiment".
    
    Usage: dart test [files or directories...]
    
    -h, --help                            Show this usage information.
        --version                         Show the package:test version.
    

    And for some reason we're parsing usage: as a URI we need to convert. When we send this to the VM, the isolate seems to exit.

    This may or may not be related, but:

    • we shouldn't be trying to convert usage:
    • we perhaps should not see an isolate terminate when we do this was actually exiting because the process didn't start
    • the error output above should be visible to the user
  4. DanTup commented on Jan 24, 2023

    @DanTup
    MemberAuthor

    With fix:

    Screenshot 2023-01-24 at 12 04 49

  5. DanTup commented on Jan 24, 2023

    @DanTup
    MemberAuthor
  6. added
    relies on sdk changesSomething that requires changes in the Dart/Flutter SDK to ship before it will become available
    on Jan 24, 2023
  7. DanTup commented on Jan 24, 2023

    @DanTup
    MemberAuthor
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 testingRelates to test execution of Dart/Flutter tests for end usersis bugrelies on sdk changesSomething that requires changes in the Dart/Flutter SDK to ship before it will become available

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions