Describe the bug
A clear and concise description of what the bug is.
When trying to run the example case referenced in the README, I get the following error:
E/flutter (30883): [ERROR:flutter/lib/ui/ui_dart_state.cc(198)] Unhandled Exception: gRPC Error (code: 14, codeName: UNAVAILABLE, message: Error connecting: SocketException: Connection refused (OS Error: Connection refused, errno = 111), address = 127.0.0.1, port = 51594, details: null, rawResponse: null, trailers: {})
Due to that error the manager application is never able to find the integration tests and so it perpetually displays "No tests found. This may because the information is not loaded.".
I do believe the manager is forming some kind of connection with the running client because pressing the button "Tap here to reload information" causes the client to perform a hot reload.
The client just displays a blank white screen.
To Reproduce
Steps to reproduce the behavior:
- Clone flutter_convient_test
- Open 2 separate terminal windows.
- In the first terminal window execute the following commands:
cd .\packages\convenient_test_manager\
flutter run -d windows --release
- In the second terminal execute the following commands:
cd .\packages\convenient_test\example\
flutter run ./integration_test/main_test.dart --host-vmservice-port 9753 --disable-service-auth-codes --dart-define CONVENIENT_TEST_APP_CODE_DIR=$($PWD | select -Expand Path)
Expected behavior
A clear and concise description of what you expected to happen.
The manager application should find all the integration tests in the example and give the option to run the tests.
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
- OS: [e.g. iOS] Windows
- Version [e.g. 22] 11
Smartphone (please complete the following information):
- Device: [e.g. iPhone6] Android Virtual Emulator - Pixel 4
- OS: [e.g. iOS8.1] Android
- Version [e.g. 22] API 30
Additional context
Add any other context about the problem here.
I tried to get around this issue by running the client within WSL ubuntu and trying to run the manager within WSL. Both result in the same error.
I also had a coworker try this on his Mac machine. He said the issue still occurs for him while using an Android Emulator but not when using the IOS simulator.
I have also tried this in our own repo instead of the example package, same error.
I also tried adjusting the values in consts.dart. I changed kConvenientTestManagerHost to my local IP address and still the same error. When I set kWorkerVmServiceHost to my local IP, I can no longer cause a hot reload in the client, so I believe that is a regression.
I have also read through pretty much every issue here: https://github.com/fzyzcjy/flutter_convenient_test/issues?q=is%3Aissue+grpc and still haven't found a solution. I know you mentioned in this comment that it was a generic network problem and not related to this package.
I realize from the error message this is definitely network related ("Error connecting: SocketException") but I do not believe my setup is in any way non-standard and a coworker was able to replicate the issue.
Could this be related to the fact that the Android Device Emulator defines the host machine on the constant address "10.0.2.2"? ref
I am not sure how one would point the client to that host because we are only passing a port in through the startup args. I am not sure if the IOS simulator on Mac redirects 127.0.0.1 to the simulator or the development machine.
By the way, thank you for such a great package! The design is great and is a wonderful contribution to the flutter ecosystem.
Manager Logs:
PS C:\Users\ethan\Documents\cadoo\flutter_convenient_test\packages\convenient_test_manager> flutter run -d windows --release
Launching lib\main.dart on Windows in release mode...
Building Windows application...
Flutter run key commands.
h List all available interactive commands.
c Clear the screen
q Quit (terminate the application on the device).
flutter: 2022-08-16T15:08:12.832046Z|debug|GlobalConfigNullable|parseConfigFile homeDirectory=null
flutter: 2022-08-16T15:08:12.833048Z|debug|GlobalConfigNullable|parse call parseConfigFile config=GlobalConfigNullable(isolationMode: null, enableReportSaver: null, goldenDiffGitRepo: null)
flutter: 2022-08-16T15:08:12.833048Z|debug|GlobalConfigNullable|parse call parseEnvironment config=GlobalConfigNullable(isolationMode: null, enableReportSaver: null, goldenDiffGitRepo: null)
flutter: 2022-08-16T15:08:12.835043Z|info|VmServiceWrapperService|Connecting to vm service at ws://127.0.0.1:9753/ws. Please ensure your Flutter app has port=9753
flutter: 2022-08-16T15:08:12.836042Z|info|setup|GlobalConfig: isolationMode: false,[NL]enableReportSaver: false,[NL]goldenDiffGitRepo: null[NL]
flutter: 2022-08-16T15:08:12.845042Z|debug|setWindowSize|window=PlatformWindow{frame: Rect.fromLTRB(17.0, 17.0, 2257.0, 1277.0), scaleFactor: 1.75, screen: Instance of 'Screen'} screen=Screen{frame: Rect.fromLTRB(0.0, 0.0, 3840.0, 2400.0), visibleFrame: Rect.fromLTRB(0.0, 0.0, 3840.0, 2316.0), scaleFactor: 1.75}
flutter: 2022-08-16T15:08:12.846040Z|info|GoldenDiffPageStore|syncGitInfoFromRepo gitRepo=null
flutter: 2022-08-16T15:08:14.884684Z|warn|VmServiceWrapperService|init failed e=SocketException: The remote computer refused the network connection.
flutter: [NL] (OS Error: The remote computer refused the network connection.
flutter: [NL], errno = 1225), address = 127.0.0.1, port = 57880 s=#0 _NativeSocket.startConnect (dart:io-patch/socket_patch.dart:682)[NL]#1 _RawSocket.startConnect (dart:io-patch/socket_patch.dart:1817)[NL]#2 RawSocket.startConnect (dart:io-patch/socket_patch.dart:27)[NL]#3 Socket._startConnect (dart:io-patch/socket_patch.dart:2038)[NL]#4 Socket.startConnect (dart:io/socket.dart:759)[NL]#5 _ConnectionTarget.connect (dart:_http/http_impl.dart:2453)[NL]#6 _HttpClient._getConnection.connect (dart:_http/http_impl.dart:2867)[NL]#7 _HttpClient._getConnection (dart:_http/http_impl.dart:2872)[NL]#8 _HttpClient._openUrl (dart:_http/http_impl.dart:2727)[NL]#9 _HttpClient.openUrl (dart:_http/http_impl.dart:2591)[NL]#10 _WebSocketImpl.connect (dart:_http/we
flutter: bsocket_impl.dart:1021)[NL]#11 WebSocket.connect (dart:_http/websocket.dart:360)[NL]#12 vmServiceConnectUri (package:vm_service/vm_service_io.dart:32)[NL]#13 VmServiceWrapperService.connect (package:convenient_test_manager_dart/services/vm_service_wrapper_service.dart:30)[NL]#14 new VmServiceWrapperService (package:convenient_test_manager_dart/services/vm_service_wrapper_service.dart:20)[NL]#15 setup (package:convenient_test_manager_dart/misc/setup.dart:37)[NL]<asynchronous suspension>[NL]#16 setup (package:convenient_test_manager/misc/setup.dart:21)[NL]<asynchronous suspension>[NL]#17 main (package:convenient_test_manager/main.dart:7)[NL]<asynchronous suspension>[NL]
flutter: 2022-08-16T15:09:29.585945Z|info|VmServiceWrapperService|Connecting to vm service at ws://127.0.0.1:9753/ws. Please ensure your Flutter app has port=9753
flutter: 2022-08-16T15:09:29.588943Z|info|_ServiceConnectionManager|vmServiceOpened
flutter: 2022-08-16T15:09:29.654944Z|info|_ServiceConnectionManager|handleServiceEvent kind=ServiceRegistered service=reloadSources method=s0.reloadSources
flutter: 2022-08-16T15:09:29.654944Z|info|_ServiceConnectionManager|handleServiceEvent kind=ServiceRegistered service=hotRestart method=s0.hotRestart
flutter: 2022-08-16T15:09:29.655948Z|info|_ServiceConnectionManager|handleServiceEvent kind=ServiceRegistered service=flutterVersion method=s0.flutterVersion
flutter: 2022-08-16T15:09:29.655948Z|info|_ServiceConnectionManager|handleServiceEvent kind=ServiceRegistered service=compileExpression method=s0.compileExpression
flutter: 2022-08-16T15:09:29.655948Z|info|_ServiceConnectionManager|handleServiceEvent kind=ServiceRegistered service=flutterMemoryInfo method=s0.flutterMemoryInfo
flutter: 2022-08-16T15:09:29.655948Z|info|_ServiceConnectionManager|handleServiceEvent kind=ServiceRegistered service=flutterGetSkSL method=s0.flutterGetSkSL
flutter: 2022-08-16T15:09:33.120960Z|info|VmServiceWrapperService|hotRestartThrottled triggered
flutter: 2022-08-16T15:09:33.120960Z|debug|SingleRunningExecutor|call runner() reason= triggerTime=2022-08-16 11:09:33.120960 arg=null
flutter: 2022-08-16T15:09:33.120960Z|info|_ServiceConnectionManager|hotRestart start
flutter: 2022-08-16T15:09:37.392235Z|info|_ServiceConnectionManager|hotRestart end resp={type: Success}
flutter: 2022-08-16T15:09:37.392235Z|debug|VmServiceWrapperService|hotRestartThrottledExecutor deliberately extra wait
Application finished.
Terminate batch job (Y/N)? Y
Client Logs:
PS C:\Users\ethan\Documents\cadoo\flutter_convenient_test\packages\convenient_test\example> flutter run .\integration_test\main_test.dart --host-vmservice-port 9753 --disable-service-auth-codes --dart-define CONVENIENT_TEST_APP_CODE_DIR=$($PWD | select -Expand Path)
Using hardware rendering with device sdk gphone x86. If you notice graphics artifacts, consider enabling software
rendering with "--enable-software-rendering".
Launching .\integration_test\main_test.dart on sdk gphone x86 in debug mode...
Running Gradle task 'assembleDebug'... 5.5s
√ Built build\app\outputs\flutter-apk\app-debug.apk.
E/flutter (30883): [ERROR:flutter/lib/ui/ui_dart_state.cc(198)] Unhandled Exception: gRPC Error (code: 14, codeName: UNAVAILABLE, message: Error connecting: SocketException: Connection refused (OS Error: Connection refused, errno = 111), address = 127.0.0.1, port = 51592, details: null, rawResponse: null, trailers: {})
E/flutter (30883):
Syncing files to device sdk gphone x86... 218ms
Flutter run key commands.
r Hot reload.
R Hot restart.
h List all available interactive commands.
d Detach (terminate "flutter run" but leave application running).
c Clear the screen
q Quit (terminate the application on the device).
Running with sound null safety
An Observatory debugger and profiler on sdk gphone x86 is available at: http://127.0.0.1:9753/
Performing hot restart...
Restarted application in 4,263ms.
E/flutter (30883): [ERROR:flutter/lib/ui/ui_dart_state.cc(198)] Unhandled Exception: gRPC Error (code: 14, codeName: UNAVAILABLE, message: Error connecting: SocketException: Connection refused (OS Error: Connection refused, errno = 111), address = 127.0.0.1, port = 51594, details: null, rawResponse: null, trailers: {})
E/flutter (30883):
Application finished.
Terminate batch job (Y/N)? Y
wontfix