-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gRPC Error causes No tests found #253
Comments
Hi! Thanks for opening your first issue here! 😄 |
You are welcome! Yes I think it is a network problem. Looks like your manager is connecting to localhost:9753:
So maybe try to hack it to other IPs and see what happens. Currently all things are hardcoded in source code:
So need to clone the code and modify it, e.g. the |
Thank you for responding so quickly! Line 27 in 46e31ec
I know that the manager can access the client somewhat because it can cause a hot reload in the client. The problem seems to be communication from the client back to the manager. I can also navigate to 127.0.0.1:9753 with my web browser and I see the following page: I have tried changing the values in |
You are welcome :)
That log is not error. It just says where we are connecting.
Oh I see, given the evidence so 127.0.0.1 maybe ok for the manager connecting to client. So maybe change the ip from client to manager? And, maybe try to connect to the specific host/port from client to manager. If it fails, we know it has problem |
Ah gotcha, my bad with confusion around log message. How would I go about changing the address that the client is using to connect to manager? I know that in the android device emulator, |
What about trying to change |
Solved by setting: You were pretty much dead on from the beginning. I didn't realize that Every person using this within Android Device Emulator will hit this same problem. Maybe add something in the README stating this? Or it would be super cool if the plugin could dynamically detect this with https://pub.dev/packages/device_info_plus and switch dynamically. If you would use this I can make a PR. Thanks again for the help @fzyzcjy! |
You are welcome!
Sure :) Looking forward to your PR! |
Not sure how this will be done? The current issue is that, the worker do not know the ip of master. But device info only tells the ip of worker imho |
That LGTM :) |
|
Couldn't get everything working as I wanted perfectly because of the need for a widget binding, but created a starter branch here: #256 |
I am experiencing the same issue when attempting to use a physical device instead of a simulator (simulators work properly)
I am using the latest master branches of the flutter_convenient_test I tried changing using the CONVENIENT_TEST_MANAGER_HOST variable both on the client and the server to the local WIFI address of the physical device, but I still keep getting the same error and the I tried both with a Pixel 3 and an iPhone 12 Mini, both resulted in the same error @fzyzcjy Have you used a physical device successfully before? @ethancadoo Are you able to use a physical device? |
@borjandev I have not played with a physical device yet, but definitely it should work given correct address.
That sound incorrect. "manager" is the desktop app, while "worker" is on the phone. So change WORKER_HOST |
@borjandev this is what's working for me with the Android emulator - it would be similar to a wifi network as the emulator should connect via 10.0.2.2 . Step 1:You need to use the latest packages as that's where the override from environment variables is available.
dependencies:
dev_dependencies:
Step 2Run flutter:
|
@ronba I believe that looks right. The command that works for me on windows with the android emulator is:
And in different terminal I run:
Are you able to see anything by navigating to "127.0.0.1:9753" in your web browser? My relevant section of the pubspec.yaml:
|
Any progress on this? It's really annoying :| |
@bartekpacia does the workaround mentioned above solve your problem? |
I haven't tried, to be honest, but I'm sure it would. What I'm asking for is a bit more official solution, for example the possibility to set |
Totally agree. Looking forward to your PR! |
I'm surely submit something when I find some free time :) |
Hey! I'm having this issue. I'm using physical devices and the error happens on both iOS and Android. This is the command I'm running And the error I'm getting is
|
IIRC, physical devices cannot use 127.0.0.1 |
@fzyzcjy Ah, so how would I go about using this package to run integration tests on a physical device? Thanks for the quick response by the way! |
@DanMossa That is unrelated to this package indeed, but a general grpc (or network?) question. A quick guess: Say you are using wifi to connect phone and computer, and computer has 192.168.0.101 while phone has 192.168.0.102. Then maybe use those 192 ip instead of 127.0.0.1. |
Sorry for all the questions, this is just new to me. |
@DanMossa google it :) different computers (win mac linux) etc have different methods |
@fzyzcjy Oh! I understand what you mean. I didn't realize. Okay perfect. Thank you! |
You are welcome! |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
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 issue. |
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:
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):
Smartphone (please complete the following information):
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:
Client Logs:
The text was updated successfully, but these errors were encountered: