Skip to content

Commit 30543ca

Browse files
authored
Add more logging around iframe startup (#2160)
We see are getting some logs from the browser that shows some of the test suites have a "Starting suite" output but no "sending channel to host" output. Add more logging to the console to further narrow down where things may be getting stuck. - Add a log statement after appending the iframe to the page. - Add a log statement at the beginning of the `main` that is loaded in the iframe.
1 parent e56a5e2 commit 30543ca

File tree

4 files changed

+6
-1
lines changed

4 files changed

+6
-1
lines changed

pkgs/test/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
## 1.25.1-wip
2+
13
## 1.25.0
24

35
* Handle paths with leading `/` when spawning test isolates.

pkgs/test/lib/src/runner/browser/compilers/dart2js.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,10 +142,12 @@ class Dart2JsSupport implements CompilerSupport {
142142
var bootstrapContent = '''
143143
${suiteConfig.metadata.languageVersionComment ?? await rootPackageLanguageVersionComment}
144144
import 'package:test/src/bootstrap/browser.dart';
145+
import 'package:test/src/runner/browser/dom.dart' as dom;
145146
146147
import '${await absoluteUri(dartPath)}' as test;
147148
148149
void main() {
150+
dom.window.console.log('Startup for test path $dartPath');
149151
internalBootstrapBrowserTest(() => test.main);
150152
}
151153
''';

pkgs/test/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: test
2-
version: 1.25.0
2+
version: 1.25.1-wip
33
description: >-
44
A full featured library for writing and running Dart tests across platforms.
55
repository: https://github.com/dart-lang/test/tree/master/pkgs/test

pkgs/test/tool/host.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,7 @@ StreamChannel<dynamic> _connectToIframe(String url, int id) {
246246

247247
iframe.src = url;
248248
dom.document.body!.appendChild(iframe);
249+
dom.window.console.log('Appended iframe with src $url');
249250

250251
return controller.foreign;
251252
}

0 commit comments

Comments
 (0)