Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
gopls/internal/regtest: fix TestFailingDiagnosticClearingOnEdit
This test was asserting immediately on the non-presence of published diagnostics, and therefore was racing with the diagnostics calculation pass. Following https://go.dev/cl/420539 this became a flake, because once gopls has calculated diagnostics for the open event, it will actually publish empty diagnostics for the opened file. Update the test to use a OnceMet so that we only evaluate the expectation once we've finished the diagnostics pass. As a result, the test deterministically failed, which was fixed by using the EmptyOrNoDiagnostics expectation. Fixes golang/go#54271 Change-Id: Id3f220ce44c7996132699a724b6c627f034e367f Reviewed-on: https://go-review.googlesource.com/c/tools/+/422136 gopls-CI: kokoro <[email protected]> Run-TryBot: Robert Findley <[email protected]> Reviewed-by: Peter Weinberger <[email protected]> TryBot-Result: Gopher Robot <[email protected]>
- Loading branch information