Repository navigation
flutter_tester hangs on linux workstation #19273
Copy link
Copy link
Labels
a: tests"flutter test", flutter_test, or one of our tests"flutter test", flutter_test, or one of our tests
Description
On my Linux workstation, running flutter tester just hangs and doesn't find a flutter view to run on.
Repro:
flutter create mytestcd mytestflutter run -d flutter-tester --verbose- fails with a stack trace and
Error connecting to the service protocol: Exception: No Flutter view is available
The same thing works fine on my mac, and flutter tester tests seem to run fine on the bots.
I have tried:
- killing all flutter_tester processes (there were 10 running! I think it's not dying properly either).
- rebooting my machine
- nuking my cache directory and git pulling from master again.
- running flutter_tester manually directly. It runs and just sits there not reporting any errors.
I'm using master branch HEAD at 36e16e7.
Here's the entire output:
(home/gspencer:master) -- test_reload > flutter run -d flutter-tester --verbose
[ +42 ms] [/usr/local/google/home/gspencer/code/flutter/] git rev-parse --abbrev-ref --symbolic @{u}
[ +40 ms] Exit code 128 from: git rev-parse --abbrev-ref --symbolic @{u}
[ ] fatal: no upstream configured for branch 'master'
[ ] [/usr/local/google/home/gspencer/code/flutter/] git rev-parse --abbrev-ref HEAD
[ +6 ms] Exit code 0 from: git rev-parse --abbrev-ref HEAD
[ ] master
[ ] [/usr/local/google/home/gspencer/code/flutter/] git log -n 1 --pretty=format:%H
[ +7 ms] Exit code 0 from: git log -n 1 --pretty=format:%H
[ ] 36e16e754433a1357e7f49af8c1221d70b67bc79
[ ] [/usr/local/google/home/gspencer/code/flutter/] git log -n 1 --pretty=format:%ar
[ +6 ms] Exit code 0 from: git log -n 1 --pretty=format:%ar
[ ] 68 minutes ago
[ +1 ms] [/usr/local/google/home/gspencer/code/flutter/] git describe --match v*.*.* --first-parent --long --tags
[ +25 ms] Exit code 0 from: git describe --match v*.*.* --first-parent --long --tags
[ ] v0.5.6-97-g36e16e754
[ +102 ms] /usr/local/google/home/gspencer/Android/Sdk/platform-tools/adb devices -l
[ +11 ms] Exit code 0 from: /usr/local/google/home/gspencer/Android/Sdk/platform-tools/adb devices -l
[ ] List of devices attached
84B7N15A07007628 device usb:2-2.3 product:angler model:Nexus_6P device:angler transport_id:1
[ +210 ms] Found plugin shared_preferences at /usr/local/google/home/gspencer/code/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences-0.4.2/
[ +792 ms] Launching lib/main.dart on Flutter test device in debug mode...
[ +389 ms] DependencyChecker: nothing is modified after 2018-07-11 10:44:23.408.
[ +208 ms] Skipping kernel compilation. Fingerprint match.
[ +285 ms] Building bundle
[ ] Writing asset files to build/flutter_assets
[ +66 ms] Wrote build/flutter_assets
[ ] /usr/local/google/home/gspencer/code/flutter/bin/cache/artifacts/engine/linux-x64/flutter_tester --run-forever --non-interactive --enable-dart-profiling --packages=.packages --flutter-assets-dir=build/flutter_assets build/app.dill
[ +243 ms] Observatory URL on device: http://127.0.0.1:34079/
[ +6 ms] Connecting to service protocol: http://127.0.0.1:34079/
[ +195 ms] Successfully connected to service protocol: http://127.0.0.1:34079/
[ +3 ms] getVM: {}
[ +11 ms] Waiting for Flutter view
[ +187 ms] Do not know weight for: TeXGyreSchola (BoldItalic)
[ +813 ms] Waiting for Flutter view
[+1004 ms] Waiting for Flutter view
[+1000 ms] Waiting for Flutter view
[+1000 ms] Waiting for Flutter view
[+1002 ms] No Flutter views available on Flutter test device
[ +6 ms] Error connecting to the service protocol: Exception: No Flutter view is available
[ +21 ms] "flutter run" took 7,512ms.
#0 throwToolExit (package:flutter_tools/src/base/common.dart:26)
#1 RunCommand.runCommand (package:flutter_tools/src/commands/run.dart:406)
<asynchronous suspension>
#2 FlutterCommand.verifyThenRunCommand (package:flutter_tools/src/runner/flutter_command.dart:347)
#3 _asyncThenWrapperHelper.<anonymous closure> (dart:async-patch/dart:async/async_patch.dart:77)
#4 _rootRunUnary (dart:async/zone.dart:1134)
#5 _CustomZone.runUnary (dart:async/zone.dart:1031)
#6 _FutureListener.handleValue (dart:async/future_impl.dart:129)
#7 Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:638)
#8 Future._propagateToListeners (dart:async/future_impl.dart:667)
#9 Future._complete (dart:async/future_impl.dart:472)
#10 _SyncCompleter.complete (dart:async/future_impl.dart:51)
#11 _AsyncAwaitCompleter.complete (dart:async-patch/dart:async/async_patch.dart:28)
#12 _completeOnAsyncReturn (dart:async-patch/dart:async/async_patch.dart:292)
#13 RunCommand.usageValues (package:flutter_tools/src/commands/run.dart:211)
#14 _asyncThenWrapperHelper.<anonymous closure> (dart:async-patch/dart:async/async_patch.dart:77)
#15 _rootRunUnary (dart:async/zone.dart:1134)
#16 _CustomZone.runUnary (dart:async/zone.dart:1031)
#17 _FutureListener.handleValue (dart:async/future_impl.dart:129)
#18 Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:638)
#19 Future._propagateToListeners (dart:async/future_impl.dart:667)
#20 Future._complete (dart:async/future_impl.dart:472)
#21 _SyncCompleter.complete (dart:async/future_impl.dart:51)
#22 _AsyncAwaitCompleter.complete.<anonymous closure> (dart:async-patch/dart:async/async_patch.dart:33)
#23 _rootRun (dart:async/zone.dart:1126)
#24 _CustomZone.run (dart:async/zone.dart:1023)
#25 _CustomZone.bindCallback.<anonymous closure> (dart:async/zone.dart:949)
#26 _microtaskLoop (dart:async/schedule_microtask.dart:41)
#27 _startMicrotaskLoop (dart:async/schedule_microtask.dart:50)
#28 _runPendingImmediateCallback (dart:isolate-patch/dart:isolate/isolate_patch.dart:113)
#29 _RawReceivePortImpl._handleMessage (dart:isolate-patch/dart:isolate/isolate_patch.dart:166)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
a: tests"flutter test", flutter_test, or one of our tests"flutter test", flutter_test, or one of our tests
Activity
devoncarew commentedon Jul 11, 2018
/cc @scheglov @DanTup
DanTup commentedon Jul 12, 2018
I think there are some flutter_tester tests in flutter_tools that just run non-Flutter Dart scripts - if you run it manually like that (which is just running the binary and giving it any old Dart file) does it work as expected (I think it should run the Dart script and then terminate at the end)?
jason-simmons commentedon Jul 13, 2018
In this scenario, the app is throwing an exception when run from flutter_tester on a Linux platform:
This started with b3a6eda
@Hixie
DanTup commentedon Jul 13, 2018
Ah yes :(
Although, I don't think this is the real issue @gspencergoog was hitting when running the tests (which is why he was trying to use flutter-tester directly with
flutter run) as when running the tests we set theFLUTTER_TESTenv variable:flutter/packages/flutter_tools/test/integration/test_driver.dart
Lines 141 to 144 in 8359d99
Which forces Android:
flutter/packages/flutter/lib/src/foundation/platform.dart
Lines 60 to 61 in b3a6eda
DanTup commentedon Jul 13, 2018
Actually, we set this variable also when spawning flutter_tester from inside the tools:
flutter/packages/flutter_tools/lib/src/tester/flutter_tester.dart
Lines 153 to 156 in b3a6eda
So it shouldn't be affecting
flutter run -d flutter-testereither?jason-simmons commentedon Jul 13, 2018
acf3f3d is causing flutter_tools to exit when used with
-d flutter-tester.Prior to this change, flutter_tools would build and run the app code under flutter_tester and then query the service protocol for the list of Flutter views. The service protocol would return an empty list, and connectToServiceProtocol() would consider that acceptable. (Other service protocol operations like hot reload would not work though).
WIth acf3f3d, flutter_tools will exit if the view list is empty.
DanTup commentedon Jul 16, 2018
I'm not sure what the expected behaviour - is it right that there are no views for a sample app created with
flutter create? If not, is the change bad?(Also, why aren't any builds broken?)
DanTup commentedon Oct 8, 2018
Dart Code's integration tests are intermittently failing on Linux with this issue too:
I don't know if it's gotten worse but I do seem to have a lot of failures on Linux lately (these aren't all the issue described here, but all the failures are on Linux - orange is skipped, not flaky!).
DanTup commentedon Oct 8, 2018
Actually, looking at a few results, it seems like this might have regressed. The
flutter attachtests are failing with this onmaster(2nd + 4th cols) but passing onbeta(1st + 3rd cols). Appears consistent across the last few test runs I've looked at.Edit: There are other tests failing for the same reason on
betatoo, so it seems this issue isn't exclude tomaster(though it does seem consistent on the attach test - could be complete coincidence).Hixie commentedon Oct 18, 2018
I see this on master now:
jason-simmons commentedon Oct 18, 2018
test/integration/hot_reload_testregressed in fd8a960DanTup commentedon Oct 19, 2018
@Hixie @jason-simmons Can either of you reproduce it with the debug printing turned on (
_printJsonAndStderrintest_driver.dart)? I can't repro locally (though I do see #23285).I'll see if I can improve this error too; it should probably include the last few events it received in the message.
DanTup commentedon Oct 19, 2018
(I just realised the title here mentions Linux - is that where you're seeing this? I've been testing on macOS)
DanTup commentedon Oct 19, 2018
With the change in #23287 the error above should include the recent messages received from the
flutter runprocess. This should make it easier to understand the failure without having to enable verbose/debug logging (which is trickier for CIs).@Hixie If you patch that change in and repro the issue does it give a better indication of what failed?
Example output:
18 remaining items
Fix a race condition in vmservice_test.dart (#23835)
vineetkala11 commentedon Nov 9, 2018
I am facing same issue with window -
Launching lib\main.dart on Android SDK built for x86 in debug mode...
Initializing gradle...
Resolving dependencies...
Gradle task 'assembleDebug'...
Built build\app\outputs\apk\debug\app-debug.apk.
No Flutter views available on Android SDK built for x86
Error connecting to the service protocol: Exception: No Flutter view is available
dnfield commentedon Nov 9, 2018
@vineetkala11 can you try latest on master and see if it still reproduces? The patch for this just landed an about an hour ago.
vineetkala11 commentedon Nov 9, 2018
Using Command as Administrator solves my problem.
bormisov1 commentedon Nov 12, 2018
@dnfield
I'm having the same
Error connecting to the service protocol: Exception: No Flutter view is availablewhen I run my project in VS CodeAt first I thought that maybe it didn't update properly and ran commands below in flutter directory, but the error still appears when I run the app for the first time after some pause (second and third launches in a row are ok)
tvolkert commentedon Nov 13, 2018
@bormisov1 #23835 hasn't made it to the beta channel yet. You can try on the master channel to test it with the fix.
github-actions commentedon Sep 1, 2021
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.