Skip to content

Commit

Permalink
gopls/internal/test: await quiescence in TestInconsistentVendoring
Browse files Browse the repository at this point in the history
TestInconsistentVendoring was awaiting only the initial workspace load
before capturing diagnostics and running their code action. But opening
a/a1.go also triggers diagnostics. This can cause the file lock failures
observed in golang/go#64229. To fix this, wait for the change (the
didOpen) to be fully processed.

Fixes golang/go#64229

Change-Id: I747ea22db02b8def4bf7764714db7f901891792d
Reviewed-on: https://go-review.googlesource.com/c/tools/+/558076
Reviewed-by: Alan Donovan <adonovan@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Robert Findley <rfindley@google.com>
  • Loading branch information
findleyr authored and gopherbot committed Jan 24, 2024
1 parent df2fa1e commit 8174727
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions gopls/internal/test/integration/misc/vendor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,7 @@ func _() {
).Run(t, pkgThatUsesVendoring, func(t *testing.T, env *Env) {
env.OpenFile("a/a1.go")
d := &protocol.PublishDiagnosticsParams{}
env.OnceMet(
InitialWorkspaceLoad,
env.AfterChange(
Diagnostics(env.AtRegexp("go.mod", "module mod.com"), WithMessage("Inconsistent vendoring")),
ReadDiagnostics("go.mod", d),
)
Expand Down

0 comments on commit 8174727

Please sign in to comment.