-
Notifications
You must be signed in to change notification settings - Fork 18k
x/tools/gopls: no diagnostics received for initially empty files (sometimes) #39646
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
Comments
FYI we're still seeing ~1 failure per day (in a build matrix of 12 entries) in the |
Thanks for the report! I am going to convert this into a gopls regression test and see if I can reproduce the issue. |
Change https://golang.org/cl/240063 mentions this issue: |
I tried to reproduce the test as carefully as possible in my CL, but I haven't been able to trigger the failure. The issue is that the new files are getting treated like In the logs, I see |
Change-Id: I51d8c66a83ecae1c8fc1f39c0e90a03a732c263b Reviewed-on: https://go-review.googlesource.com/c/tools/+/240063 Run-TryBot: Rebecca Stambler <rstambler@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Robert Findley <rfindley@google.com>
Change https://golang.org/cl/240098 mentions this issue: |
* gopls/internal/hooks, internal/lsp/source: only match full words in link regexes 0cc1aa72 * internal/lsp: support opening single files f01a4bec * internal/lsp/regtest: add regression tests for on-disk file changes ea7be8d7 * gopls/doc/troubleshooting.md: update the gopls output channel name 7cb253f4 * internal/lsp/source: speed up completion candidate formatting 1837592e * internal/lsp/cmd: change pre-filled issue header for gopls bug 9a0e0698 * internal/lsp: decorate error message from workspace/configuration a32c0cb1 * go/packages: move all overlay tests into overlay_test.go c138986d * internal/lsp: remove VS Code-specific completion hack b2d8b033 * internal/lsp/cache: handle a few possible panics in PackageStats 4bdfe1a3 * internal/analysisinternal: prevent fillstruct panic on nil package aa3d5013 * internal/lsp/source: add a new symbolStyle configuration option aa94e735 * internal/lsp: fully qualify workspace Symbol matches 84cfedeb * internal/lsp: add a new regtest to reproduce golang/go#39646 bcbc01e0 * internal/lsp/fake: explicitly set GOPACKAGESDRIVER=off in regtests 6506e20d * internal/lsp: watch all files in the module and replace target fadf93ff
* gopls/internal/hooks, internal/lsp/source: only match full words in link regexes 0cc1aa72 * internal/lsp: support opening single files f01a4bec * internal/lsp/regtest: add regression tests for on-disk file changes ea7be8d7 * gopls/doc/troubleshooting.md: update the gopls output channel name 7cb253f4 * internal/lsp/source: speed up completion candidate formatting 1837592e * internal/lsp/cmd: change pre-filled issue header for gopls bug 9a0e0698 * internal/lsp: decorate error message from workspace/configuration a32c0cb1 * go/packages: move all overlay tests into overlay_test.go c138986d * internal/lsp: remove VS Code-specific completion hack b2d8b033 * internal/lsp/cache: handle a few possible panics in PackageStats 4bdfe1a3 * internal/analysisinternal: prevent fillstruct panic on nil package aa3d5013 * internal/lsp/source: add a new symbolStyle configuration option aa94e735 * internal/lsp: fully qualify workspace Symbol matches 84cfedeb * internal/lsp: add a new regtest to reproduce golang/go#39646 bcbc01e0 * internal/lsp/fake: explicitly set GOPACKAGESDRIVER=off in regtests 6506e20d * internal/lsp: watch all files in the module and replace target fadf93ff
* internal/lsp/lsprpc: improvements to daemon logging f2c07d7d * internal/lsp/regtest: simpler way to invert options cf799cae * internal/lsp: don't keep track of closed overlays 43ed9469 * internal/lsp: fix error in CL 242457 e66011cb * internal/lsp: clean up the code lens code a8f9df4c * internal/lsp: refactor generate code lens code c80dc571 * go/packages: add x test overlay test 130c9f19 * internal/lsp: add an importShortcut configuration ddb87c8c * internal/lsp: handle nil pointer in PackageStats 4cea8971 * internal/lsp/source: handle nil pointer in newBuiltinSignature b42590c1 * internal/lsp: avoid panic caused by assuming file ends with newline 9048b464 * internal/lsp: always show signature as the top line in hover 6acd2ab8 * gopls, internal/lsp: support an extra formatting hook for gofumpt 62a0bb78 * internal/lsp: add changeMethods logic to rename check f8240f79 * internal/lsp/source: add Vendor to list of supported commands 01425d70 * internal/analysisinternal: do not initialize {Get,Set}TypeErrors f739c553 * internal/lsp: watch go.{mod,sum} files, as well as Go files fd294ab1 * internal/lsp/cmd: add a -vv flag for higher verbosity 7342f973 * internal/lsp, go/packages: reproduce and fix golang/go#39646 f1c4188a * internal/lsp: add new go.mod requires to files with unused require 125cc70a * internal/lsp: fix rename with Windows line endings 55a0fde5 * internal/lsp/regtest: standardize on 20s timeout e327e101 * internal/lsp/regtest: use a common directory for regtest sandboxes e404ca24 * internal/lsp/regtest: remove stray short timeout df98bc6d * internal/lsp/regtest: add a regtest for golang/go#39296 3544e8c9 * internal/lsp/cache: handle missing mod file 31b9a748 * internal/lsp: check if analysis enabled in convenience fixes 7370b034 * internal/lsp/regtest: await IWL before running tests 134513de * internal/lsp/source: disable fillstruct by default d5a74533 * internal/lsp/cache: fix race in RunProcessEnvFunc 065b96d3 * internal/lsp: extract highlighted selection to variable 9c9572d6 * internal/imports: require valid options, move LocalPrefix up 416e8f4f * internal/lsp/analysis/fillstruct: support anonymous structs 9e0a013e * cmd/goyacc: print newlines more consistently b22de682 * all: update dependencies in go.mod file 682c4542 * internal/lsp/source: handle nil pointer in comment completions 95bc2bdf
* internal/lsp: add a configuration to enable/disable links in hover 6ddee643 * internal/lsp: log errors for compute fix edits instead of returning d518495e * internal/lsp: refactor go.mod diagnostics to simplify the API 58eba7e7 * internal/lsp/lsprpc: improvements to daemon logging f2c07d7d * internal/lsp/regtest: simpler way to invert options cf799cae * internal/lsp: don't keep track of closed overlays 43ed9469 * internal/lsp: fix error in CL 242457 e66011cb * internal/lsp: clean up the code lens code a8f9df4c * internal/lsp: refactor generate code lens code c80dc571 * go/packages: add x test overlay test 130c9f19 * internal/lsp: add an importShortcut configuration ddb87c8c * internal/lsp: handle nil pointer in PackageStats 4cea8971 * internal/lsp/source: handle nil pointer in newBuiltinSignature b42590c1 * internal/lsp: avoid panic caused by assuming file ends with newline 9048b464 * internal/lsp: always show signature as the top line in hover 6acd2ab8 * gopls, internal/lsp: support an extra formatting hook for gofumpt 62a0bb78 * internal/lsp: add changeMethods logic to rename check f8240f79 * internal/lsp/source: add Vendor to list of supported commands 01425d70 * internal/analysisinternal: do not initialize {Get,Set}TypeErrors f739c553 * internal/lsp: watch go.{mod,sum} files, as well as Go files fd294ab1 * internal/lsp/cmd: add a -vv flag for higher verbosity 7342f973 * internal/lsp, go/packages: reproduce and fix golang/go#39646 f1c4188a * internal/lsp: add new go.mod requires to files with unused require 125cc70a * internal/lsp: fix rename with Windows line endings 55a0fde5 * internal/lsp/regtest: standardize on 20s timeout e327e101 * internal/lsp/regtest: use a common directory for regtest sandboxes e404ca24 * internal/lsp/regtest: remove stray short timeout df98bc6d * internal/lsp/regtest: add a regtest for golang/go#39296 3544e8c9 * internal/lsp/cache: handle missing mod file 31b9a748 * internal/lsp: check if analysis enabled in convenience fixes 7370b034 * internal/lsp/regtest: await IWL before running tests 134513de * internal/lsp/source: disable fillstruct by default d5a74533 * internal/lsp/cache: fix race in RunProcessEnvFunc 065b96d3 * internal/lsp: extract highlighted selection to variable 9c9572d6 * internal/imports: require valid options, move LocalPrefix up 416e8f4f * internal/lsp/analysis/fillstruct: support anonymous structs 9e0a013e * cmd/goyacc: print newlines more consistently b22de682 * all: update dependencies in go.mod file 682c4542 * internal/lsp/source: handle nil pointer in comment completions 95bc2bdf
* internal/lsp: add a configuration to enable/disable links in hover 6ddee643 * internal/lsp: log errors for compute fix edits instead of returning d518495e * internal/lsp: refactor go.mod diagnostics to simplify the API 58eba7e7 * internal/lsp/lsprpc: improvements to daemon logging f2c07d7d * internal/lsp/regtest: simpler way to invert options cf799cae * internal/lsp: don't keep track of closed overlays 43ed9469 * internal/lsp: fix error in CL 242457 e66011cb * internal/lsp: clean up the code lens code a8f9df4c * internal/lsp: refactor generate code lens code c80dc571 * go/packages: add x test overlay test 130c9f19 * internal/lsp: add an importShortcut configuration ddb87c8c * internal/lsp: handle nil pointer in PackageStats 4cea8971 * internal/lsp/source: handle nil pointer in newBuiltinSignature b42590c1 * internal/lsp: avoid panic caused by assuming file ends with newline 9048b464 * internal/lsp: always show signature as the top line in hover 6acd2ab8 * gopls, internal/lsp: support an extra formatting hook for gofumpt 62a0bb78 * internal/lsp: add changeMethods logic to rename check f8240f79 * internal/lsp/source: add Vendor to list of supported commands 01425d70 * internal/analysisinternal: do not initialize {Get,Set}TypeErrors f739c553 * internal/lsp: watch go.{mod,sum} files, as well as Go files fd294ab1 * internal/lsp/cmd: add a -vv flag for higher verbosity 7342f973 * internal/lsp, go/packages: reproduce and fix golang/go#39646 f1c4188a * internal/lsp: add new go.mod requires to files with unused require 125cc70a * internal/lsp: fix rename with Windows line endings 55a0fde5 * internal/lsp/regtest: standardize on 20s timeout e327e101 * internal/lsp/regtest: use a common directory for regtest sandboxes e404ca24 * internal/lsp/regtest: remove stray short timeout df98bc6d * internal/lsp/regtest: add a regtest for golang/go#39296 3544e8c9 * internal/lsp/cache: handle missing mod file 31b9a748 * internal/lsp: check if analysis enabled in convenience fixes 7370b034 * internal/lsp/regtest: await IWL before running tests 134513de * internal/lsp/source: disable fillstruct by default d5a74533 * internal/lsp/cache: fix race in RunProcessEnvFunc 065b96d3 * internal/lsp: extract highlighted selection to variable 9c9572d6 * internal/imports: require valid options, move LocalPrefix up 416e8f4f * internal/lsp/analysis/fillstruct: support anonymous structs 9e0a013e * cmd/goyacc: print newlines more consistently b22de682 * all: update dependencies in go.mod file 682c4542 * internal/lsp/source: handle nil pointer in comment completions 95bc2bdf
@myitcv: Sorry for the delay on this. Are you still seeing this with |
@stamblerre - I've just submitted govim/govim@c8c4a6f to verify. |
This appears to still be flakey using 44a2922: we had two flakes in https://github.com/govim/govim/actions/runs/247768908 |
Is there a way to see the |
Note to self--from the earlier logs, the pass case has packages.Loads at snapshots 0, 6, and 12, whereas fail also has a load at snapshot 3. The regression test currently loads at 0, 3, 6, 9, and 12. |
They are available in the artifacts, for example (looking at the run Paul linked above) the artifact file:
With the failed test found in the archive as: |
We will setup a tip instance in our build matrix and try it out. |
Closing this issue, as there hasn't been any activity on it for several months. |
As golang/go#39646 is closed we now re-enable the skipped test.
As golang/go#39646 is closed we now re-enable the skipped test.
As golang/go#39646 is closed we now re-enable the skipped test.
As golang/go#39646 is closed we now re-enable the skipped test.
As golang/go#39646 is closed we now re-enable the skipped test.
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
govim
has a test that verifies we receive expected diagnostics in the case where files are initially empty on disk, but subsequently get populated with content in the editor.https://github.com/govim/govim/blob/e2a1802131f331832d667736aa27f023636f0c3a/cmd/govim/testdata/scenario_default/quickfix_empty_files.txt
Recently (apologies, I can't be any more specific than saying "in the last 2-3 weeks) we have started to see, and continue to see, a small number of flakes in this test.
In a normal run of this test we expect a set of diagnostics; when we see these flakes, we don't see any diagnostics.
Here is a
gopls
log file from a passing test run. Notice theDidChange
notifications, as well as thePublishDiagnostics
notifications: gopls.logAnd here is the
gopls
log from a failing test run. Notice theDidChange
notifications, but noPublishDiagnostics
notifications: gopls.logWhat did you expect to see?
A consistently passing test.
What did you see instead?
Flakes as described above.
cc @stamblerre @findleyr
FYI @leitzler
The text was updated successfully, but these errors were encountered: