go/gopls/internal/regtest
Robert Findley 090b14e850 internal/lsp/regtest: make TestResolveImportCycle robust to error order
In JSON output, the Go command was only setting the Error field for one
package involved in an import cycle. As a result, TestResolveImportCycle
was dependent on the chosen package, causing flakes when the chosen
package is not deterministic.

Arguably this behavior should be fixed, both in the go command and in
gopls, but for now make the test resilient to choice by asserting on any
of the possible errors.

Add a new AnyOf expectation to support this type of assertion and tweak the
test output formatting. Also update the test to eagerly fail once the
didOpen notification has been fully processed, so that we don't have to
wait for the assertion timeout.

Updates golang/go#52904

Change-Id: Ic209d8fdcb7308c041b287a8f122c47e96d29a96
Reviewed-on: https://go-review.googlesource.com/c/tools/+/406274
Reviewed-by: Michael Matloob <matloob@golang.org>
Run-TryBot: Robert Findley <rfindley@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
gopls-CI: kokoro <noreply+kokoro@google.com>
2022-05-13 22:16:40 +00:00
..
bench internal/lsp/cache: use cached parsed files for symbols, if available 2022-05-09 17:04:06 +00:00
codelens internal/lsp/regtest: eliminate arbitrary timeouts 2022-01-25 21:51:33 +00:00
completion internal/lsp: add completion for use directives 2022-03-10 23:20:43 +00:00
diagnostics internal/lsp/regtest: make TestResolveImportCycle robust to error order 2022-05-13 22:16:40 +00:00
misc gopls/internal/regtest: add a test for using staticcheck with generics 2022-05-11 20:19:40 +00:00
modfile gopls/internal/regtest/modfile: temporarily skip TestSumUpdateFixesDiagnostics 2022-04-07 15:21:45 +00:00
template internal/lsp/template: fix processing of multi-line tokens 2022-03-17 15:18:29 +00:00
watch gopls/internal/regtest: clean up TestFillReturnsPanic 2021-06-03 18:03:08 +00:00
workspace internal/lsp/cache: invalidate packages that have added files 2022-05-02 22:20:22 +00:00