Skip to content

Commit 8367fb2

Browse files
findleyrgopherbot
authored andcommitted
gopls/internal/regtest: await go.work changes in TestAddAndRemoveGoWork
To temporarily avoid flakes, wait for go.work changes to be processed before reopening files. This merely works around the underlying bug, as noted in the comment. For golang/go#57508 Change-Id: I80d24c16ff709ff77a0fb07dd3ac7275bc8bcb5a Reviewed-on: https://go-review.googlesource.com/c/tools/+/459784 Auto-Submit: Robert Findley <[email protected]> gopls-CI: kokoro <[email protected]> TryBot-Result: Gopher Robot <[email protected]> Run-TryBot: Robert Findley <[email protected]> Reviewed-by: Alan Donovan <[email protected]>
1 parent 3b16059 commit 8367fb2

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

gopls/internal/regtest/workspace/workspace_test.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1134,6 +1134,14 @@ use (
11341134
// Removing the go.work file should put us back where we started.
11351135
env.RemoveWorkspaceFile("go.work")
11361136

1137+
// TODO(golang/go#57508): because file watching is asynchronous, we must
1138+
// ensure that the go.work change is seen before other changes, in order
1139+
// for the snapshot to "know" about the orphaned b/main.go below.
1140+
//
1141+
// This is a bug, plain and simple, but we await here to avoid test flakes
1142+
// while the underlying cause is fixed.
1143+
env.Await(env.DoneWithChangeWatchedFiles())
1144+
11371145
// TODO(rfindley): fix this bug: reopening b/main.go is necessary here
11381146
// because we no longer "see" the file in any view.
11391147
env.CloseBuffer("b/main.go")

0 commit comments

Comments
 (0)