From 9669fdc2832fe1130eb3fd19b338762eeefb09b8 Mon Sep 17 00:00:00 2001 From: Gary Roumanis Date: Mon, 19 Mar 2018 11:26:13 -0700 Subject: [PATCH 1/2] workaround for sdk issue --- CHANGELOG.md | 4 ++++ lib/src/runner/browser/dartium.dart | 2 +- lib/src/runner/remote_listener.dart | 4 ++++ pubspec.yaml | 2 +- 4 files changed, 10 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7ecfd4451..467d4f4f6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.12.32+2 + +* Provide a work around for dart-lang/sdk/issues/32556. + ## 0.12.32+1 * Fix a bug that broke content shell on Dart 1.24. diff --git a/lib/src/runner/browser/dartium.dart b/lib/src/runner/browser/dartium.dart index b17861fd9..fb8f27462 100644 --- a/lib/src/runner/browser/dartium.dart +++ b/lib/src/runner/browser/dartium.dart @@ -155,7 +155,7 @@ class Dartium extends Browser { /// parameter name will change in Dart 2.0. try { return (await inCompletionOrder(operations) - .firstWhere((url) => url != null)) as Uri; + .firstWhere((url) => url != null)); } on StateError catch (_) { return null; } diff --git a/lib/src/runner/remote_listener.dart b/lib/src/runner/remote_listener.dart index 67b4d123a..db1ff215b 100644 --- a/lib/src/runner/remote_listener.dart +++ b/lib/src/runner/remote_listener.dart @@ -61,6 +61,10 @@ class RemoteListener { channel.sink.add({"type": "print", "line": line}); }); + // Work-around for https://github.com/dart-lang/sdk/issues/32556. Remove + // once fixed. + new Stream.fromIterable([]).listen((_) {}).cancel(); + new SuiteChannelManager().asCurrent(() { new StackTraceFormatter().asCurrent(() { runZoned(() async { diff --git a/pubspec.yaml b/pubspec.yaml index ad2618794..474c5e7a5 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,5 +1,5 @@ name: test -version: 0.12.32+1 +version: 0.12.32+2 author: Dart Team description: A library for writing dart unit tests. homepage: https://github.com/dart-lang/test From 701904ef41f03045982e5cdc192fa0b1102033a4 Mon Sep 17 00:00:00 2001 From: Gary Roumanis Date: Mon, 19 Mar 2018 16:21:26 -0700 Subject: [PATCH 2/2] add back cast and update changelog --- CHANGELOG.md | 2 +- lib/src/runner/browser/dartium.dart | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 467d4f4f6..506dbf28d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ ## 0.12.32+2 -* Provide a work around for dart-lang/sdk/issues/32556. +* Work around an SDK bug that caused timeouts in asynchronous code. ## 0.12.32+1 diff --git a/lib/src/runner/browser/dartium.dart b/lib/src/runner/browser/dartium.dart index fb8f27462..b17861fd9 100644 --- a/lib/src/runner/browser/dartium.dart +++ b/lib/src/runner/browser/dartium.dart @@ -155,7 +155,7 @@ class Dartium extends Browser { /// parameter name will change in Dart 2.0. try { return (await inCompletionOrder(operations) - .firstWhere((url) => url != null)); + .firstWhere((url) => url != null)) as Uri; } on StateError catch (_) { return null; }