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/vulndb/internal/symbols: TestPatchedSymbols fails unless it is run inside a git repository checkout #69671

Open
gopherbot opened this issue Sep 27, 2024 · 2 comments
Labels
NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. vulncheck or vulndb Issues for the x/vuln or x/vulndb repo

Comments

@gopherbot
Copy link
Contributor

#!watchflakes
default <- pkg == "golang.org/x/vulndb/internal/symbols" && test == "TestPatchedSymbols"

Issue created automatically to collect these failures.

Example (log):

=== RUN   TestPatchedSymbols
    patched_functions_test.go:42: lstat testdata/module: no such file or directory
    patched_functions_test.go:46: lstat testdata/fixed-module: no such file or directory
    patched_functions_test.go:54: (-got, want+):
          map[symbols.symKey]bool{
        + 	{pkg: "golang.org/module", symbol: "Foo"}:          true,
        + 	{pkg: "golang.org/module/internal", symbol: "Bar"}: true,
          }
    patched_functions_test.go:42: lstat testdata/module: no such file or directory
    patched_functions_test.go:46: lstat testdata/fixed-module: no such file or directory
    patched_functions_test.go:54: (-got, want+):
          map[symbols.symKey]bool{
        + 	{pkg: "golang.org/nestedmodule", file: "main_linux.go", symbol: "main"}: true,
          }
--- FAIL: TestPatchedSymbols (0.00s)

watchflakes

@gopherbot gopherbot added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Sep 27, 2024
@gopherbot
Copy link
Contributor Author

Found new dashboard test flakes for:

#!watchflakes
default <- pkg == "golang.org/x/vulndb/internal/symbols" && test == "TestPatchedSymbols"
2024-09-25 17:43 x_vulndb-go1.22-darwin-amd64-longtest vulndb@18cdc252 release-branch.go1.22@b4086b7c x/vulndb/internal/symbols.TestPatchedSymbols (log)
=== RUN   TestPatchedSymbols
    patched_functions_test.go:42: lstat testdata/module: no such file or directory
    patched_functions_test.go:46: lstat testdata/fixed-module: no such file or directory
    patched_functions_test.go:54: (-got, want+):
          map[symbols.symKey]bool{
        + 	{pkg: "golang.org/module", symbol: "Foo"}:          true,
        + 	{pkg: "golang.org/module/internal", symbol: "Bar"}: true,
          }
    patched_functions_test.go:42: lstat testdata/module: no such file or directory
    patched_functions_test.go:46: lstat testdata/fixed-module: no such file or directory
    patched_functions_test.go:54: (-got, want+):
          map[symbols.symKey]bool{
        + 	{pkg: "golang.org/nestedmodule", file: "main_linux.go", symbol: "main"}: true,
          }
--- FAIL: TestPatchedSymbols (0.00s)
2024-09-25 17:43 x_vulndb-go1.22-darwin-amd64-race vulndb@18cdc252 release-branch.go1.22@b4086b7c x/vulndb/internal/symbols.TestPatchedSymbols (log)
=== RUN   TestPatchedSymbols
    patched_functions_test.go:42: lstat testdata/module: no such file or directory
    patched_functions_test.go:46: lstat testdata/fixed-module: no such file or directory
    patched_functions_test.go:54: (-got, want+):
          map[symbols.symKey]bool{
        + 	{pkg: "golang.org/module", symbol: "Foo"}:          true,
        + 	{pkg: "golang.org/module/internal", symbol: "Bar"}: true,
          }
    patched_functions_test.go:42: lstat testdata/module: no such file or directory
    patched_functions_test.go:46: lstat testdata/fixed-module: no such file or directory
    patched_functions_test.go:54: (-got, want+):
          map[symbols.symKey]bool{
        + 	{pkg: "golang.org/nestedmodule", file: "main_linux.go", symbol: "main"}: true,
          }
--- FAIL: TestPatchedSymbols (0.00s)
2024-09-25 17:43 x_vulndb-go1.22-darwin-amd64_14 vulndb@18cdc252 release-branch.go1.22@b4086b7c x/vulndb/internal/symbols.TestPatchedSymbols (log)
=== RUN   TestPatchedSymbols
    patched_functions_test.go:42: lstat testdata/module: no such file or directory
    patched_functions_test.go:46: lstat testdata/fixed-module: no such file or directory
    patched_functions_test.go:54: (-got, want+):
          map[symbols.symKey]bool{
        + 	{pkg: "golang.org/module", symbol: "Foo"}:          true,
        + 	{pkg: "golang.org/module/internal", symbol: "Bar"}: true,
          }
    patched_functions_test.go:42: lstat testdata/module: no such file or directory
    patched_functions_test.go:46: lstat testdata/fixed-module: no such file or directory
    patched_functions_test.go:54: (-got, want+):
          map[symbols.symKey]bool{
        + 	{pkg: "golang.org/nestedmodule", file: "main_linux.go", symbol: "main"}: true,
          }
--- FAIL: TestPatchedSymbols (0.00s)
2024-09-25 17:43 x_vulndb-go1.23-darwin-amd64-longtest vulndb@18cdc252 release-branch.go1.23@fbddfae6 x/vulndb/internal/symbols.TestPatchedSymbols (log)
=== RUN   TestPatchedSymbols
    patched_functions_test.go:42: lstat testdata/module: no such file or directory
    patched_functions_test.go:46: lstat testdata/fixed-module: no such file or directory
    patched_functions_test.go:54: (-got, want+):
          map[symbols.symKey]bool{
        + 	{pkg: "golang.org/module", symbol: "Foo"}:          true,
        + 	{pkg: "golang.org/module/internal", symbol: "Bar"}: true,
          }
    patched_functions_test.go:42: lstat testdata/module: no such file or directory
    patched_functions_test.go:46: lstat testdata/fixed-module: no such file or directory
    patched_functions_test.go:54: (-got, want+):
          map[symbols.symKey]bool{
        + 	{pkg: "golang.org/nestedmodule", file: "main_linux.go", symbol: "main"}: true,
          }
--- FAIL: TestPatchedSymbols (0.00s)
2024-09-25 17:43 x_vulndb-go1.23-darwin-amd64-race vulndb@18cdc252 release-branch.go1.23@fbddfae6 x/vulndb/internal/symbols.TestPatchedSymbols (log)
=== RUN   TestPatchedSymbols
    patched_functions_test.go:42: lstat testdata/module: no such file or directory
    patched_functions_test.go:46: lstat testdata/fixed-module: no such file or directory
    patched_functions_test.go:54: (-got, want+):
          map[symbols.symKey]bool{
        + 	{pkg: "golang.org/module", symbol: "Foo"}:          true,
        + 	{pkg: "golang.org/module/internal", symbol: "Bar"}: true,
          }
    patched_functions_test.go:42: lstat testdata/module: no such file or directory
    patched_functions_test.go:46: lstat testdata/fixed-module: no such file or directory
    patched_functions_test.go:54: (-got, want+):
          map[symbols.symKey]bool{
        + 	{pkg: "golang.org/nestedmodule", file: "main_linux.go", symbol: "main"}: true,
          }
--- FAIL: TestPatchedSymbols (0.00s)
2024-09-25 17:43 x_vulndb-go1.23-darwin-amd64_14 vulndb@18cdc252 release-branch.go1.23@fbddfae6 x/vulndb/internal/symbols.TestPatchedSymbols (log)
=== RUN   TestPatchedSymbols
    patched_functions_test.go:42: lstat testdata/module: no such file or directory
    patched_functions_test.go:46: lstat testdata/fixed-module: no such file or directory
    patched_functions_test.go:54: (-got, want+):
          map[symbols.symKey]bool{
        + 	{pkg: "golang.org/module", symbol: "Foo"}:          true,
        + 	{pkg: "golang.org/module/internal", symbol: "Bar"}: true,
          }
    patched_functions_test.go:42: lstat testdata/module: no such file or directory
    patched_functions_test.go:46: lstat testdata/fixed-module: no such file or directory
    patched_functions_test.go:54: (-got, want+):
          map[symbols.symKey]bool{
        + 	{pkg: "golang.org/nestedmodule", file: "main_linux.go", symbol: "main"}: true,
          }
--- FAIL: TestPatchedSymbols (0.00s)
2024-09-25 17:43 x_vulndb-gotip-darwin-amd64-longtest vulndb@18cdc252 go@7d91cc26 x/vulndb/internal/symbols.TestPatchedSymbols (log)
=== RUN   TestPatchedSymbols
    patched_functions_test.go:42: lstat testdata/module: no such file or directory
    patched_functions_test.go:46: lstat testdata/fixed-module: no such file or directory
    patched_functions_test.go:54: (-got, want+):
          map[symbols.symKey]bool{
        + 	{pkg: "golang.org/module", symbol: "Foo"}:          true,
        + 	{pkg: "golang.org/module/internal", symbol: "Bar"}: true,
          }
    patched_functions_test.go:42: lstat testdata/module: no such file or directory
    patched_functions_test.go:46: lstat testdata/fixed-module: no such file or directory
    patched_functions_test.go:54: (-got, want+):
          map[symbols.symKey]bool{
        + 	{pkg: "golang.org/nestedmodule", file: "main_linux.go", symbol: "main"}: true,
          }
--- FAIL: TestPatchedSymbols (0.00s)
2024-09-25 17:43 x_vulndb-gotip-darwin-amd64-race vulndb@18cdc252 go@7d91cc26 x/vulndb/internal/symbols.TestPatchedSymbols (log)
=== RUN   TestPatchedSymbols
    patched_functions_test.go:42: lstat testdata/module: no such file or directory
    patched_functions_test.go:46: lstat testdata/fixed-module: no such file or directory
    patched_functions_test.go:54: (-got, want+):
          map[symbols.symKey]bool{
        + 	{pkg: "golang.org/module", symbol: "Foo"}:          true,
        + 	{pkg: "golang.org/module/internal", symbol: "Bar"}: true,
          }
    patched_functions_test.go:42: lstat testdata/module: no such file or directory
    patched_functions_test.go:46: lstat testdata/fixed-module: no such file or directory
    patched_functions_test.go:54: (-got, want+):
          map[symbols.symKey]bool{
        + 	{pkg: "golang.org/nestedmodule", file: "main_linux.go", symbol: "main"}: true,
          }
--- FAIL: TestPatchedSymbols (0.00s)
2024-09-25 17:43 x_vulndb-gotip-darwin-amd64_14 vulndb@18cdc252 go@7d91cc26 x/vulndb/internal/symbols.TestPatchedSymbols (log)
=== RUN   TestPatchedSymbols
    patched_functions_test.go:42: lstat testdata/module: no such file or directory
    patched_functions_test.go:46: lstat testdata/fixed-module: no such file or directory
    patched_functions_test.go:54: (-got, want+):
          map[symbols.symKey]bool{
        + 	{pkg: "golang.org/module", symbol: "Foo"}:          true,
        + 	{pkg: "golang.org/module/internal", symbol: "Bar"}: true,
          }
    patched_functions_test.go:42: lstat testdata/module: no such file or directory
    patched_functions_test.go:46: lstat testdata/fixed-module: no such file or directory
    patched_functions_test.go:54: (-got, want+):
          map[symbols.symKey]bool{
        + 	{pkg: "golang.org/nestedmodule", file: "main_linux.go", symbol: "main"}: true,
          }
--- FAIL: TestPatchedSymbols (0.00s)

watchflakes

@gopherbot gopherbot added the vulncheck or vulndb Issues for the x/vuln or x/vulndb repo label Sep 27, 2024
@gopherbot gopherbot modified the milestones: Unreleased, vuln/unplanned Sep 27, 2024
@dmitshur
Copy link
Contributor

This can be reproduced locally by running the test in the x/vulndb module located in the module cache, rather than a git repository checkout. For example:

$ cd $(mktemp -d)
$ go mod init example
go: creating new go.mod: module example
$ go get -t golang.org/x/vulndb
go: added golang.org/x/vulndb v0.0.0-20240925174358-74aba449dd50
$ go test golang.org/x/vulndb/internal/symbols
--- FAIL: TestPatchedSymbols (0.00s)
    patched_functions_test.go:42: lstat testdata/module: no such file or directory
    patched_functions_test.go:46: lstat testdata/fixed-module: no such file or directory
    patched_functions_test.go:54: (-got, want+):
          map[symbols.symKey]bool{
        + 	{pkg: "golang.org/module", symbol: "Foo"}:          true,
        + 	{pkg: "golang.org/module/internal", symbol: "Bar"}: true,
          }
    patched_functions_test.go:42: lstat testdata/module: no such file or directory
    patched_functions_test.go:46: lstat testdata/fixed-module: no such file or directory
    patched_functions_test.go:54: (-got, want+):
          map[symbols.symKey]bool{
        + 	{pkg: "golang.org/nestedmodule", file: "main_linux.go", symbol: "main"}: true,
          }
--- FAIL: TestModuleSymbols (0.00s)
    patched_functions_test.go:85: lstat testdata/module: no such file or directory
    patched_functions_test.go:89: (-got, want+):
          map[symbols.symKey]bool{
        + 	{pkg: "golang.org/module", symbol: "Foo"}:          true,
        + 	{pkg: "golang.org/module", symbol: "main"}:         true,
        + 	{pkg: "golang.org/module/internal", symbol: "Bar"}: true,
          }
    patched_functions_test.go:85: lstat testdata/module/submodule: no such file or directory
    patched_functions_test.go:89: (-got, want+):
          map[symbols.symKey]bool{
        + 	{pkg: "golang.org/nestedmodule", file: "main_linux.go", symbol: "main"}:   true,
        + 	{pkg: "golang.org/nestedmodule", file: "main_windows.go", symbol: "main"}: true,
          }
--- FAIL: TestModuleRootAndFiles (0.00s)
    patched_functions_test.go:127: lstat testdata/module: no such file or directory
    patched_functions_test.go:132: got []; want [bar.go foo.go main.go]
    patched_functions_test.go:137: module root: got ; want module
    patched_functions_test.go:127: lstat testdata/module: no such file or directory
    patched_functions_test.go:132: got []; want [main_linux.go main_windows.go]
    patched_functions_test.go:137: module root: got ; want module/submodule
    patched_functions_test.go:127: lstat testdata/module: no such file or directory
    patched_functions_test.go:127: lstat testdata/module: no such file or directory
--- FAIL: TestModuleRoots (0.00s)
    patched_functions_test.go:157: lstat testdata/module: no such file or directory
FAIL
FAIL	golang.org/x/vulndb/internal/symbols	0.633s
FAIL

This particular failure wasn't reported by builders until #65267 was resolved. Since it's a pre-existing issue, x/vulndb was opted out in crrev.com/c/5889407.

@dmitshur dmitshur changed the title x/vulndb/internal/symbols: TestPatchedSymbols failures x/vulndb/internal/symbols: TestPatchedSymbols fails unless it is run inside a git repository checkout Sep 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. vulncheck or vulndb Issues for the x/vuln or x/vulndb repo
Projects
None yet
Development

No branches or pull requests

2 participants