From 4818d9eec9ede7da284bef811eb0a7835d9a41df Mon Sep 17 00:00:00 2001 From: Robert Findley Date: Mon, 17 Oct 2022 17:08:50 +0000 Subject: [PATCH] Revert "gopls/internal/lsp/cache: disable strict analysis while we fix panics" This reverts commit 9b5e55b1a7e215a54c9784492d801104a8381a91. Reason for revert: Should have been fixed by https://go.dev/cl/443100 Change-Id: I44eeff6605697b745c3729ac1ec49b9c09114f71 Reviewed-on: https://go-review.googlesource.com/c/tools/+/443340 gopls-CI: kokoro Reviewed-by: Alan Donovan Run-TryBot: Robert Findley TryBot-Result: Gopher Robot --- gopls/internal/lsp/cache/analysis.go | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/gopls/internal/lsp/cache/analysis.go b/gopls/internal/lsp/cache/analysis.go index c75b8de36b..6da77b5904 100644 --- a/gopls/internal/lsp/cache/analysis.go +++ b/gopls/internal/lsp/cache/analysis.go @@ -261,12 +261,7 @@ func actionImpl(ctx context.Context, snapshot *snapshot, deps []*actionHandle, a // discover this problem in regular packages. // For command-line-arguments we quietly abort the analysis // for now since we already know there is a bug. - - // Temporarily disable bug reporting due to golang/go#56035: using - // bug.Errorf causes too many test flakes. - // TODO(rfindley): switch back to bug.Errorf once panics are fixed. - errorf := fmt.Errorf - + errorf := bug.Errorf // report this discovery if source.IsCommandLineArguments(pkg.ID()) { errorf = fmt.Errorf // suppress reporting } @@ -372,9 +367,9 @@ func actionImpl(ctx context.Context, snapshot *snapshot, deps []*actionHandle, a // An Analyzer crashed. This is often merely a symptom // of a problem in package loading. // - // We are aware of a likely cause for these panics: the actionHandle - // cache key is not correct. In the meantime, disable strict mode. - const strict = false + // We believe that CL 420538 may have fixed these crashes, so enable + // strict checks in tests. + const strict = true if strict && bug.PanicOnBugs && analyzer.Name != "fact_purity" { // During testing, crash. See issues 54762, 56035. // But ignore analyzers with known crash bugs: