Skip to content

Set a debug name for test isolates #2494

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

Merged
merged 9 commits into from
May 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions pkgs/test/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 1.26.1-wip

* Set a debug name for test isolates.

## 1.26.0

* `test()` and `group()` functions now take an optional `TestLocation` that will
Expand Down
4 changes: 2 additions & 2 deletions pkgs/test/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: test
version: 1.26.0
version: 1.26.1-wip
description: >-
A full featured library for writing and running Dart tests across platforms.
repository: https://github.com/dart-lang/test/tree/master/pkgs/test
Expand Down Expand Up @@ -37,7 +37,7 @@ dependencies:

# Use an exact version until the test_api and test_core package are stable.
test_api: 0.7.5
test_core: 0.6.9
test_core: 0.6.10-wip

typed_data: ^1.3.0
web_socket_channel: '>=2.0.0 <4.0.0'
Expand Down
4 changes: 4 additions & 0 deletions pkgs/test_core/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.6.10-wip

* Set a debug name for test isolates.

## 0.6.9

* Add support for native assets for `dart test` in pub workspaces.
Expand Down
20 changes: 16 additions & 4 deletions pkgs/test_core/lib/src/runner/vm/platform.dart
Original file line number Diff line number Diff line change
Expand Up @@ -246,8 +246,14 @@ stderr: ${processResult.stderr}''');

/// Runs [uri] in an isolate, passing [message].
Future<Isolate> _spawnIsolateWithUri(Uri uri, SendPort message) async {
return await Isolate.spawnUri(uri, [], message,
packageConfig: await packageConfigUri, checked: true);
return await Isolate.spawnUri(
uri,
[],
message,
packageConfig: await packageConfigUri,
checked: true,
debugName: 'test_suite:$uri',
);
}

Future<Isolate> _spawnPrecompiledIsolate(String testPath, SendPort message,
Expand Down Expand Up @@ -284,8 +290,14 @@ stderr: ${processResult.stderr}''');
packageConfig = null;
}
}
return await Isolate.spawnUri(testUri, [], message,
packageConfig: packageConfig?.uri, checked: true);
return await Isolate.spawnUri(
testUri,
[],
message,
packageConfig: packageConfig?.uri,
checked: true,
debugName: 'test_suite:$testUri',
);
}

/// Bootstraps the test at [testPath] and writes its contents to a temporary
Expand Down
2 changes: 1 addition & 1 deletion pkgs/test_core/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: test_core
version: 0.6.9
version: 0.6.10-wip
description: A basic library for writing tests and running them on the VM.
repository: https://github.com/dart-lang/test/tree/master/pkgs/test_core
issue_tracker: https://github.com/dart-lang/test/issues?q=is%3Aissue+is%3Aopen+label%3Apackage%3Atest
Expand Down