Repository navigation
Fix web tests on Linux #2147
Copy link
Copy link
Closed
Labels
Milestone
Description
Web tests always fail on Linux on GH Actions with the error below.
Wondering if this is similar to an issue seen in DevTools where running non-headless Chrome would fail on Linux Travis:
However, I can't figure out why the web tests for Flutter would work fine (or if there's a way to force headless mode for the webdev daemon to test if that helps). Disabling these tests on Linux for now and need to restore when I can find a fix.
[11:22:34 AM] [WebDaemon] [Info] [Dart & Flutter] <== [{"event":"daemon.log","params":{"log":"[INFO] ------------------------------------------------------------------------\n"}}]
[11:22:34 AM] [General] [Info] [stdout] [INFO] ------------------------------------------------------------------------
[11:22:40 AM] [WebDaemon] [Error] [Dart & Flutter] Unhandled exception:
Instance of 'AppConnectionException'
#0 DevHandler.startDebugService (package:dwds/src/handlers/dev_handler.dart:147:7)
<asynchronous suspension>
#1 DevHandler.loadAppServices.<anonymous closure> (package:dwds/src/handlers/dev_handler.dart:177:19)
<asynchronous suspension>
#2 _LinkedHashMapMixin.putIfAbsent (dart:collection-patch/compact_hash.dart:291:23)
#3 DevHandler.loadAppServices (package:dwds/src/handlers/dev_handler.dart:175:24)
#4 Dwds.debugConnection (package:dwds/dwds.dart:54:46)
<asynchronous suspension>
#5 AppDomain._handleAppConnections (package:webdev/src/daemon/app_domain.dart:63:40)
<asynchronous suspension>
#6 SetMixin.forEach (dart:collection/set.dart:146:30)
#7 AppDomain._initialize (package:webdev/src/daemon/app_domain.dart:56:27)
#8 new AppDomain (package:webdev/src/daemon/app_domain.dart:128:5)
#9 DaemonCommand.run (package:webdev/src/command/daemon_command.dart:107:29)
<asynchronous suspension>
#10 CommandRunner.runCommand (package:args/command_runner.dart:197:27)
<asynchronous suspension>
#11 _CommandRunner.runCommand (package:webdev/src/webdev_command_runner.dart:38:24)
<asynchronous suspension>
#12 CommandRunner.run.<anonymous closure> (package:args/command_runner.dart:112:25)
#13 new Future.sync (dart:async/future.dart:224:31)
#14 CommandRunner.run (package:args/command_runner.dart:112:14)
#15 run (package:webdev/src/webdev_command_runner.dart:19:56)
#16 main (file:///home/runner/.pub-cache/hosted/pub.dartlang.org/webdev-2.5.4/bin/webdev.dart:17:22)
<asynchronous suspension>
#17 _startIsolate.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:303:32)
#18 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:172:12)
Reactions are currently unavailable
Activity
DanTup commentedon Dec 5, 2019
@grouma do you have any ideas about this? I definitely saw issues on Linux Travis with Chrome when running DevTools tests without using headless (it seemed like Chrome never launched properly). This feels like it might be the same, but I'm not sure why it would work when going through Flutter (the flutter web tests work, but these
webdev daemonones don't).Skip Dart-web tests on Linux
Skip Dart-web tests on Linux
DanTup commentedon Dec 5, 2019
Spoke too soon - had it on macOS too. Maybe just intermittent :(
grouma commentedon Dec 5, 2019
So this error is thrown here:
https://github.com/dart-lang/webdev/blob/2dfe6830e9692b54d2f0b214a186175cdf159b25/dwds/lib/src/handlers/dev_handler.dart#L147
It means that a debug session was initiated but we couldn't find a Dart application in the connected Chrome instance. More specifically, we couldn't find this embedded data:
https://github.com/dart-lang/webdev/blob/master/dwds/lib/src/handlers/injected_handler.dart#L108
My suggestion is to do some logging to ensure that the injected handler is actually embedding the metadata. Depending on the result I may have some other ideas.
DanTup commentedon Dec 5, 2019
Could it be that the page just hasn't loaded yet? (or even Chrome itself)? These GitHub machines are super-slow, and I noticed there's a timeout in that code:
https://github.com/dart-lang/webdev/blob/2dfe6830e9692b54d2f0b214a186175cdf159b25/dwds/lib/src/handlers/dev_handler.dart#L128-L129
I'm not sure where to put this since it's all internal to webdev. Is there a convenient way to add debug logging (and have it spat out to stdout so it'll show in my CI logs?).
grouma commentedon Dec 5, 2019
It's unlikely because
startDebugServicesrequires anAppConnectionwhich requires an established SSE connection. In fact, I retract my previous comment. The injection handler must have properly run to get anAppConection. It's possible that the debug event for the execution context has not been received yet. Feel free to play with that timeout to see if it reduces flakiness. We can extend it, just not substantially, because we do need to eventually return an error if the tab does not contain a Dart application.Skip Dart-web tests on Linux
Unskip web tests on Linux CI