Skip to content

Commit 0d1b478

Browse files
committed
gopls/internal/test/integration: fix flakiness of TestResolveImportCycle
Avoid flaky dependence on go list error messages in TestResolveImportCycle. It would be better if we could guarantee that the error is from go list, but since the error from golang/go#64899 is reasonable, it is best to just avoid the flake for now. Fixes golang/go#64899 Change-Id: If5038acbdf020323d8fa9db0d8e1e8e054cfe464 Reviewed-on: https://go-review.googlesource.com/c/tools/+/556495 LUCI-TryBot-Result: Go LUCI <[email protected]> Reviewed-by: Alan Donovan <[email protected]>
1 parent d517112 commit 0d1b478

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

gopls/internal/test/integration/diagnostics/diagnostics_test.go

+8-3
Original file line numberDiff line numberDiff line change
@@ -1672,12 +1672,17 @@ const B = a.B
16721672
env.OpenFile("b/b.go")
16731673
env.AfterChange(
16741674
// The Go command sometimes tells us about only one of the import cycle
1675-
// errors below. For robustness of this test, succeed if we get either.
1675+
// errors below. Also, sometimes we get an error during type checking
1676+
// instead of during list, due to missing metadata. This is likely due to
1677+
// a race.
1678+
// For robustness of this test, succeed if we get any reasonable error.
16761679
//
16771680
// TODO(golang/go#52904): we should get *both* of these errors.
1681+
// TODO(golang/go#64899): we should always get an import cycle error
1682+
// rather than a missing metadata error.
16781683
AnyOf(
1679-
Diagnostics(env.AtRegexp("a/a.go", `"mod.test/b"`), WithMessage("import cycle")),
1680-
Diagnostics(env.AtRegexp("b/b.go", `"mod.test/a"`), WithMessage("import cycle")),
1684+
Diagnostics(env.AtRegexp("a/a.go", `"mod.test/b"`)),
1685+
Diagnostics(env.AtRegexp("b/b.go", `"mod.test/a"`)),
16811686
),
16821687
)
16831688
env.RegexpReplace("b/b.go", `const B = a\.B`, "")

0 commit comments

Comments
 (0)