-
Notifications
You must be signed in to change notification settings - Fork 18k
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
cmd/go: a few go tests fails on host with no network connection #26007
Comments
|
I have looked in to this a bit as I'm hitting this issue on Fedora build system(koji) which is disconnected from the internet. Where I would love to run as much as possible from the test suite to smoke test the build. Also I have opened the CL120735 with possible workaround. Base on the discussion with @ianlancetaylor there I plan to bring this topic up on golang-dev to solicit more feedback. |
Investigated further and it seems that the HasExternalNetwork() guarding the check out is set to the true even in short mode, although other tests seem to have it set correctly and the flag is set in tests invocation. Expanding the guard with the testing.Short() leads to correct skip of the tests. Digging further. |
More digging in. It seems that there is some issue with the generated test binaries as in reduce reproducer(https://play.golang.org/p/y2fWT66LK86 , needs to be placed intree so it have access to the internal package) seems to always execute the first branch(i.e. incorrect value of HasExternalNetwork) regardless of setting of the short mode. This seems to only affect the testMain/HasExternalNetwork, detection of short mode seems to be fine in individual tests(commenting out the testmain bits). I haven't examined the generated binaries yet. I have observed same behavior with go1.10. I will continue digging on Mon. |
I've lost track now. Is there a test case in the standard library that is using the external network even though it uses |
You are right I have missed that, but to be honest it is kind of counter intuitive and it is the core of this issue. Yes and no, no all are guarded by the I will update the CL with correct fix for this bug. And for go1.12 I will commit to make "long" tests be possible to be executed without networking via the env var. |
Change https://golang.org/cl/120735 mentions this issue: |
This seems to got reintroduce with latest merge of vgo. It seems that the test got moved around as its now located in different test package.
Unfortunately I do not have power to reopen this issue. |
Change https://golang.org/cl/123735 mentions this issue: |
What version of Go are you using (
go version
)?tip
Does this issue reproduce with the latest release?
yes
What operating system and processor architecture are you using (
go env
)?any
What did you do?
run all.bash on a standalone host
What did you expect to see?
no failure
What did you see instead?
a few? vendored packages under cmd/go/internal tried to fetch external resources unconditionally.
The text was updated successfully, but these errors were encountered: