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/gopls/internal/lsp/source: TestSource failures #57827

Closed
gopherbot opened this issue Jan 16, 2023 · 4 comments
Closed

x/tools/gopls/internal/lsp/source: TestSource failures #57827

gopherbot opened this issue Jan 16, 2023 · 4 comments
Assignees
Labels
gopls Issues related to the Go language server, gopls. NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. Tools This label describes issues relating to any tools in the x/tools repository.
Milestone

Comments

@gopherbot
Copy link

#!watchflakes
post <- pkg == "golang.org/x/tools/gopls/internal/lsp/source" && test == "TestSource"

Issue created automatically to collect these failures.

Example (log):

--- FAIL: TestSource (205.10s)
    --- FAIL: TestSource/Modules (60.03s)
        --- FAIL: TestSource/Modules/Diagnostics (14.28s)
            --- FAIL: TestSource/Modules/Diagnostics/bad_test (0.04s)
                source_test.go:162: bad_test.go:9:0-9:0: unmatched diagnostic pattern "Testbad has malformed name: first letter after 'Test' must not be lowercase"
                source_test.go:162: bad_test.go:13:1-13:20: unmatched diagnostic pattern "golang.org/lsptests/analyzer.printfWrapper format %s reads arg #1, but call has 0 args"
                source_test.go:162: bad_test.go:22:25-22:35: unmatched diagnostic pattern "2006-02-01 should be 2006-01-02"
    --- FAIL: TestSource/GOPATH (67.67s)
        --- FAIL: TestSource/GOPATH/Diagnostics (0.90s)
            --- FAIL: TestSource/GOPATH/Diagnostics/bad_test (0.03s)
                source_test.go:162: bad_test.go:9:0-9:0: unmatched diagnostic pattern "Testbad has malformed name: first letter after 'Test' must not be lowercase"
                source_test.go:162: bad_test.go:13:1-13:20: unmatched diagnostic pattern "golang.org/lsptests/analyzer.printfWrapper format %s reads arg #1, but call has 0 args"
                source_test.go:162: bad_test.go:22:25-22:35: unmatched diagnostic pattern "2006-02-01 should be 2006-01-02"
    --- FAIL: TestSource/MultiModule (77.41s)
        --- FAIL: TestSource/MultiModule/Diagnostics (0.78s)
            --- FAIL: TestSource/MultiModule/Diagnostics/bad_test (0.01s)
                source_test.go:162: bad_test.go:9:0-9:0: unmatched diagnostic pattern "Testbad has malformed name: first letter after 'Test' must not be lowercase"
                source_test.go:162: bad_test.go:13:1-13:20: unmatched diagnostic pattern "golang.org/lsptests/analyzer.printfWrapper format %s reads arg #1, but call has 0 args"
                source_test.go:162: bad_test.go:22:25-22:35: unmatched diagnostic pattern "2006-02-01 should be 2006-01-02"

watchflakes

@gopherbot gopherbot added NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. Tools This label describes issues relating to any tools in the x/tools repository. gopls Issues related to the Go language server, gopls. labels Jan 16, 2023
@gopherbot gopherbot added this to the Unreleased milestone Jan 16, 2023
@gopherbot
Copy link
Author

Found new dashboard test flakes for:

#!watchflakes
post <- pkg == "golang.org/x/tools/gopls/internal/lsp/source" && test == "TestSource"
2023-01-06 17:06 darwin-amd64-12_0 tools@16b3bf8d go@eeaf508d x/tools/gopls/internal/lsp/source.TestSource (log)
--- FAIL: TestSource (205.10s)
    --- FAIL: TestSource/Modules (60.03s)
        --- FAIL: TestSource/Modules/Diagnostics (14.28s)
            --- FAIL: TestSource/Modules/Diagnostics/bad_test (0.04s)
                source_test.go:162: bad_test.go:9:0-9:0: unmatched diagnostic pattern "Testbad has malformed name: first letter after 'Test' must not be lowercase"
                source_test.go:162: bad_test.go:13:1-13:20: unmatched diagnostic pattern "golang.org/lsptests/analyzer.printfWrapper format %s reads arg #1, but call has 0 args"
                source_test.go:162: bad_test.go:22:25-22:35: unmatched diagnostic pattern "2006-02-01 should be 2006-01-02"
    --- FAIL: TestSource/GOPATH (67.67s)
        --- FAIL: TestSource/GOPATH/Diagnostics (0.90s)
            --- FAIL: TestSource/GOPATH/Diagnostics/bad_test (0.03s)
                source_test.go:162: bad_test.go:9:0-9:0: unmatched diagnostic pattern "Testbad has malformed name: first letter after 'Test' must not be lowercase"
                source_test.go:162: bad_test.go:13:1-13:20: unmatched diagnostic pattern "golang.org/lsptests/analyzer.printfWrapper format %s reads arg #1, but call has 0 args"
                source_test.go:162: bad_test.go:22:25-22:35: unmatched diagnostic pattern "2006-02-01 should be 2006-01-02"
    --- FAIL: TestSource/MultiModule (77.41s)
        --- FAIL: TestSource/MultiModule/Diagnostics (0.78s)
            --- FAIL: TestSource/MultiModule/Diagnostics/bad_test (0.01s)
                source_test.go:162: bad_test.go:9:0-9:0: unmatched diagnostic pattern "Testbad has malformed name: first letter after 'Test' must not be lowercase"
                source_test.go:162: bad_test.go:13:1-13:20: unmatched diagnostic pattern "golang.org/lsptests/analyzer.printfWrapper format %s reads arg #1, but call has 0 args"
                source_test.go:162: bad_test.go:22:25-22:35: unmatched diagnostic pattern "2006-02-01 should be 2006-01-02"

watchflakes

@bcmills
Copy link
Contributor

bcmills commented Jan 17, 2023

This test does not seem to meet the bar of https://go.dev/wiki/CodeReviewComments#useful-test-failures — the test logs indicate that an expected diagnostic pattern was not matched, but there isn't any information in the test log about what happened instead.

@findleyr
Copy link
Contributor

Sadly, this is one of the LSP tests that I have already tried to improve (c.f. #54845). The test output does actually fully describe the delta between actual and expected: it is listing patterns that were expected an unmatched. The previous logic simply printed all expected and actual diagnostics, which made it hard to spot differences, and we have subsequently added support for regexp matching.

I can mail a CL that does something in-between, similar to the go/types tests.

@findleyr findleyr self-assigned this Jan 19, 2023
@dle8 dle8 modified the milestones: Unreleased, gopls/later Jan 19, 2023
@findleyr findleyr modified the milestones: gopls/later, gopls/v0.12.0 Feb 14, 2023
@findleyr
Copy link
Contributor

findleyr commented May 3, 2023

We're rewriting all of these tests in the new marker framework (gopls/internal/regtest/marker/testdata). I believe the new output for diagnostics is better.

@findleyr findleyr closed this as not planned Won't fix, can't repro, duplicate, stale May 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
gopls Issues related to the Go language server, gopls. NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. Tools This label describes issues relating to any tools in the x/tools repository.
Projects
Status: Done
Development

No branches or pull requests

4 participants