-
Notifications
You must be signed in to change notification settings - Fork 231
dart run test
w/o internet resulted in "Got socket error trying to find package analyzer ..."
#3880
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
Comments
cc @sigurdm any idea why pub has different behavoir here? |
My guess is that this is down differences in OS behavior when trying to open a socket with wifi on, but not connected and off. Why it would work like that I don't know. Not sure if we have a reliable way to detect network availability on desktop. If WIFI is off we should ideally not wait at all, but just give up. To me the "socket error" seems easier to understand than the long wait - but maybe I'm misunderstanding something. Also I don't understand why it runs the tests after giving up in the WIFI-off case. I would have expected it to halt. |
When I turn off WIFI on my mac I get a 26 second wait, and then a socket error:
|
Mmm you may be correct. I may be misremembering that. |
We should probably implement platform-specific internet-availability checks, and if we detect that no internet is available, don't wait for a time-out, but instead attempt to resolve with --offline. |
I was on a plane, w/o internet, and tried to run
dart run test test/version_test.dart
in the linter repo. My pubspec.yaml was out of date compared with.dart_tool/package_config.yaml
(unbeknownst to me). I think it had somedependency_overrides
foranalyzer
and_fe_analyzer_shared
:More interesting info:
dart run --no-pub
, but it was not in the help text (e.g.dart run --help
).Some possible resolutions:
--no-pub
to the help text.If the socket thing is an issue to be resolved in dart-lang/pub, I'm happy to track this issue over there.
The text was updated successfully, but these errors were encountered: