diff --git a/pkgs/test/CHANGELOG.md b/pkgs/test/CHANGELOG.md index c200b2189..afe8dec19 100644 --- a/pkgs/test/CHANGELOG.md +++ b/pkgs/test/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.25.12 + +* Fix hang when running multiple precompiled browser tests. + ## 1.25.11 * Update to be forward compatible with `package:shelf_web_socket` version `3.x`. diff --git a/pkgs/test/lib/src/runner/browser/platform.dart b/pkgs/test/lib/src/runner/browser/platform.dart index c4df1b32c..da03a3e00 100644 --- a/pkgs/test/lib/src/runner/browser/platform.dart +++ b/pkgs/test/lib/src/runner/browser/platform.dart @@ -211,10 +211,21 @@ class BrowserPlatform extends PlatformPlugin /// /// If no browser manager is running yet, starts one. Future<BrowserManager?> _browserManagerFor( - Runtime browser, Compiler compiler) async { + Runtime browser, Compiler compiler) { var managerFuture = _browserManagers[(browser, compiler)]; if (managerFuture != null) return managerFuture; + var future = _createBrowserManager(browser, compiler); + // Store null values for browsers that error out so we know not to load them + // again. + _browserManagers[(browser, compiler)] = + future.then<BrowserManager?>((value) => value).onError((_, __) => null); + + return future; + } + + Future<BrowserManager> _createBrowserManager( + Runtime browser, Compiler compiler) async { var support = await compilerSupport(compiler); var (webSocketUrl, socketFuture) = support.webSocket; var hostUrl = support.serverUrl @@ -224,15 +235,8 @@ class BrowserPlatform extends PlatformPlugin 'debug': _config.debug.toString() }); - var future = BrowserManager.start( + return BrowserManager.start( browser, hostUrl, socketFuture, _browserSettings[browser]!, _config); - - // Store null values for browsers that error out so we know not to load them - // again. - _browserManagers[(browser, compiler)] = - future.then<BrowserManager?>((value) => value).onError((_, __) => null); - - return future; } /// Close all the browsers that the server currently has open. diff --git a/pkgs/test/pubspec.yaml b/pkgs/test/pubspec.yaml index a66e59271..0ab65ad40 100644 --- a/pkgs/test/pubspec.yaml +++ b/pkgs/test/pubspec.yaml @@ -1,5 +1,5 @@ name: test -version: 1.25.11 +version: 1.25.12 description: >- A full featured library for writing and running Dart tests across platforms. repository: https://github.com/dart-lang/test/tree/master/pkgs/test @@ -36,7 +36,7 @@ dependencies: # Use an exact version until the test_api and test_core package are stable. test_api: 0.7.4 - test_core: 0.6.7 + test_core: 0.6.8 typed_data: ^1.3.0 web_socket_channel: '>=2.0.0 <4.0.0' diff --git a/pkgs/test/test/runner/precompiled_test.dart b/pkgs/test/test/runner/precompiled_test.dart index 8eb135d55..51dde28b9 100644 --- a/pkgs/test/test/runner/precompiled_test.dart +++ b/pkgs/test/test/runner/precompiled_test.dart @@ -42,7 +42,7 @@ void main() { test('run two precompiled tests', () async { await _precompileBrowserTest('test_2.dart'); - var test = await runTest([ + var test = await runTest(concurrency: 2, [ '-p', 'chrome', '--precompiled=precompiled/', diff --git a/pkgs/test_core/CHANGELOG.md b/pkgs/test_core/CHANGELOG.md index 321f01952..4c305bc61 100644 --- a/pkgs/test_core/CHANGELOG.md +++ b/pkgs/test_core/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.6.8 + +* Fix hang when running multiple precompiled browser tests. + ## 0.6.7 * Update the `package:vm_service` constraint to allow version `15.x`. diff --git a/pkgs/test_core/pubspec.yaml b/pkgs/test_core/pubspec.yaml index b606bb3d0..d08e24ca9 100644 --- a/pkgs/test_core/pubspec.yaml +++ b/pkgs/test_core/pubspec.yaml @@ -1,5 +1,5 @@ name: test_core -version: 0.6.7 +version: 0.6.8 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 resolution: workspace