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

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

Closed
DanTup opened this issue Jan 24, 2023 · 4 comments
Closed

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

DanTup opened this issue Jan 24, 2023 · 4 comments
Labels
in debugger Relates to the debug adapter or process of launching a debug session in testing Relates to test execution of Dart/Flutter tests for end users is bug relies on sdk changes Something that requires changes in the Dart/Flutter SDK to ship before it will become available
Milestone

Comments

@DanTup
Copy link
Member

DanTup commented Jan 24, 2023

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

@DanTup DanTup added is bug in debugger Relates to the debug adapter or process of launching a debug session in testing Relates to test execution of Dart/Flutter tests for end users labels Jan 24, 2023
@DanTup DanTup added this to the v3.60.0 milestone Jan 24, 2023
@DanTup
Copy link
Member Author

DanTup commented Jan 24, 2023

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

@DanTup
Copy link
Member Author

DanTup commented Jan 24, 2023

With fix:

Screenshot 2023-01-24 at 12 04 49

@DanTup
Copy link
Member Author

DanTup commented Jan 24, 2023

copybara-service bot pushed a commit to dart-lang/sdk that referenced this issue Jan 24, 2023
…dPackageUris

Fixes Dart-Code/Dart-Code#4358.

Change-Id: I70330d8d5dd3bdcb2aa9753212cd56ff46bf4344
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279513
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
@DanTup DanTup added the relies on sdk changes Something that requires changes in the Dart/Flutter SDK to ship before it will become available label Jan 24, 2023
@DanTup
Copy link
Member Author

DanTup commented Jan 24, 2023

Fixed by dart-lang/sdk@589876b.

@DanTup DanTup closed this as completed Jan 24, 2023
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 testing Relates to test execution of Dart/Flutter tests for end users is bug relies on sdk changes Something that requires changes in the Dart/Flutter SDK to ship before it will become available
Projects
None yet
Development

No branches or pull requests

1 participant