Skip to content

Commit

Permalink
Add more logging around iframe startup (#2160)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
natebosch committed Dec 19, 2023
1 parent e56a5e2 commit 30543ca
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions pkgs/test/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
## 1.25.1-wip

## 1.25.0

* Handle paths with leading `/` when spawning test isolates.
Expand Down
2 changes: 2 additions & 0 deletions pkgs/test/lib/src/runner/browser/compilers/dart2js.dart
Original file line number Diff line number Diff line change
Expand Up @@ -142,10 +142,12 @@ class Dart2JsSupport implements CompilerSupport {
var bootstrapContent = '''
${suiteConfig.metadata.languageVersionComment ?? await rootPackageLanguageVersionComment}
import 'package:test/src/bootstrap/browser.dart';
import 'package:test/src/runner/browser/dom.dart' as dom;
import '${await absoluteUri(dartPath)}' as test;
void main() {
dom.window.console.log('Startup for test path $dartPath');
internalBootstrapBrowserTest(() => test.main);
}
''';
Expand Down
2 changes: 1 addition & 1 deletion pkgs/test/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: test
version: 1.25.0
version: 1.25.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
1 change: 1 addition & 0 deletions pkgs/test/tool/host.dart
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,7 @@ StreamChannel<dynamic> _connectToIframe(String url, int id) {

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

return controller.foreign;
}

0 comments on commit 30543ca

Please sign in to comment.