Skip to content
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

x/tools/go/packages: TestCgoOption broken on Windows as of CL 487196 #59876

Closed
bcmills opened this issue Apr 28, 2023 · 2 comments
Closed

x/tools/go/packages: TestCgoOption broken on Windows as of CL 487196 #59876

bcmills opened this issue Apr 28, 2023 · 2 comments
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done. Soon This needs to be done soon. (regressions, serious bugs, outages) Testing An issue that has been verified to require only test changes, not just a test failure. Tools This label describes issues relating to any tools in the x/tools repository.
Milestone

Comments

@bcmills
Copy link
Contributor

bcmills commented Apr 28, 2023

https://build.golang.org/log/0fe24153d95b32025a7a17173fb145e2b460fbd4:

--- FAIL: TestCgoOption (2.04s)
    stdlib_test.go:110: no object net.addrinfoErrno
FAIL
FAIL	golang.org/x/tools/go/packages	47.889s

The underlying problem is that the test is making assumptions about the internal implementation details of the net package, and those implementation details changed in CL 487196.

The test should be fixed to not rely on the implementation details of a package outside of its own module.

(attn @matloob @adonovan)

@bcmills bcmills added Testing An issue that has been verified to require only test changes, not just a test failure. NeedsFix The path to resolution is known, but the work has not been done. Soon This needs to be done soon. (regressions, serious bugs, outages) labels Apr 28, 2023
@gopherbot gopherbot added the Tools This label describes issues relating to any tools in the x/tools repository. label Apr 28, 2023
@gopherbot gopherbot added this to the Unreleased milestone Apr 28, 2023
@adonovan
Copy link
Member

It's not clear to me how that test actually exercises the two states of the Cgo option: it used to loop over them, but that was removed in CL https://go.dev/cl/125535 (see stdlib_test.go:97). I was in the middle of writing a hermetic replacement for this test that creates a tiny module in $TMP, but then I realized there are a bunch of existing tests that seem to cover that (e.g. TestTypecheckCgo, TestCgoNoCcompiler, TestCgoMissingFile, TestLoadImportsC, TestCgoNoSyntax, testCgoBadPkgConfig).

So perhaps the right thing do is just delete this test?

@gopherbot
Copy link

Change https://go.dev/cl/490535 mentions this issue: go/packages: delete TestCgoOption as it doesn't test the cgo option

@golang golang locked and limited conversation to collaborators Apr 27, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done. Soon This needs to be done soon. (regressions, serious bugs, outages) Testing An issue that has been verified to require only test changes, not just a test failure. Tools This label describes issues relating to any tools in the x/tools repository.
Projects
None yet
Development

No branches or pull requests

3 participants