golang / go

The Go programming language
https://go.dev
BSD 3-Clause "New" or "Revised" License
124.34k stars 17.7k forks source link

x/vulndb/internal/symbols: TestPatchedSymbols fails unless it is run inside a git repository checkout #69671

Open gopherbot opened 2 months ago

gopherbot commented 2 months ago
#!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 commented 2 months ago

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

dmitshur commented 2 months ago

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.