Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x/tools/gopls: unskip all previously flaky regtests #53878

Open
5 of 8 tasks
findleyr opened this issue Jul 14, 2022 · 4 comments
Open
5 of 8 tasks

x/tools/gopls: unskip all previously flaky regtests #53878

findleyr opened this issue Jul 14, 2022 · 4 comments
Labels
gopls Testing Tools
Milestone

Comments

@findleyr
Copy link
Contributor

findleyr commented Jul 14, 2022

This is a follow up to https://go.dev/issue/53781, a deterministic panic that made it into gopls@v0.9.0 in part because a flaky regression test had been skipped, and not un-skipped when the root cause of flakiness was resolved.

We have recently made improvements to several potential sources of flakiness: server shutdown races, invalidation races, and performance. We also have resources to work on flakes that weren't available during the 1.18 push. In light of #53781, we should endeavor to unskip (and further de-flake if necessary) all regression tests that have been unconditionally skipped. This issue tracks that effort:

Currently skipped tests:

@findleyr findleyr added this to the gopls/later milestone Jul 14, 2022
@gopherbot gopherbot added Tools gopls labels Jul 14, 2022
@gopherbot
Copy link

gopherbot commented Jul 14, 2022

Change https://go.dev/cl/417576 mentions this issue: gopls/internal/regtest: unskip TestChangePackageName

@findleyr findleyr added the Testing label Jul 14, 2022
@gopherbot
Copy link

gopherbot commented Jul 22, 2022

Change https://go.dev/cl/418898 mentions this issue: gopls/internal/regtest: unskip Test_Issue38211

@gopherbot
Copy link

gopherbot commented Jul 22, 2022

Change https://go.dev/cl/419106 mentions this issue: gopls/internal/regtest: unskip TestQuickFixEmptyFiles

gopherbot pushed a commit to golang/tools that referenced this issue Jul 22, 2022
The fundamental bug causing TestChangePackageName to fail has been
fixed, yet unskipping it revealed a new bug: tracking whether or not a
package should be loaded requires that we actually store that package in
s.meta. In cases where we drop metadata, we also lose the information
that a package path needs to be reloaded.

Fix this by significantly reworking the tracking of pending loads, to
simplify the code and separate the reloading logic from the logic of
tracking metadata. As a nice side-effect, this eliminates the needless
work necessary to mark/unmark packages as needing loading, since this is
no longer tracked by the immutable metadata graph.

Additionally, eliminate the "shouldLoad" guard inside of snapshot.load.
We should never ask for loads that we do not want, and the shouldLoad
guard either masks bugs or leads to bugs. For example, we would
repeatedly call load from reloadOrphanedFiles for files that are part of
a package that needs loading, because we skip loading the file scope.
Lift the responsibility for determining if we should load to the callers
of load.

Along the way, make a few additional minor improvements:
 - simplify the code where possible
 - leave TODOs for likely bugs or things that should be simplified in
   the future
 - reduce the overly granular locking in getOrLoadIDsForURI, which could
   lead to strange races
 - remove a stale comment for a test that is no longer flaky.

Updates golang/go#53878

Change-Id: I6d9084806f1fdebc43002c7cc75dc1b94f8514b9
Reviewed-on: https://go-review.googlesource.com/c/tools/+/417576
Run-TryBot: Robert Findley <rfindley@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
Reviewed-by: Suzy Mueller <suzmue@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
gopherbot pushed a commit to golang/tools that referenced this issue Jul 25, 2022
This test ran slowly sometimes. Now that we have improved performance,
elimininated arbitrary timeouts, and improved cacheability of
computed results when running with -short, I suspect this test should no
longer flake.

If it does, we can reduce its cost in other ways rather than turning it
off entirely.

Updates golang/go#48773
Updates golang/go#53878

Change-Id: I878e78117df5a1a25f4ac5f72e02f28fc078ec73
Reviewed-on: https://go-review.googlesource.com/c/tools/+/419106
Run-TryBot: Robert Findley <rfindley@google.com>
Reviewed-by: Bryan Mills <bcmills@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
gopherbot pushed a commit to golang/tools that referenced this issue Jul 25, 2022
This test was originally skipped due to deadline exceeded errors. In the
time since, we've made performance improvements, fixed races, and
altered the regtests to remove arbitrary deadlines. Unskip it to see if
it still flakes.

For golang/go#44098
For golang/go#53878

Change-Id: I06530f2bc9c6883f415dc9147cfcbf260abb2a00
Reviewed-on: https://go-review.googlesource.com/c/tools/+/418898
Run-TryBot: Robert Findley <rfindley@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Bryan Mills <bcmills@google.com>
@gopherbot
Copy link

gopherbot commented Aug 2, 2022

Change https://go.dev/cl/420718 mentions this issue: gopls/internal/regtest: unskip all of TestModFileModification

gopherbot pushed a commit to golang/tools that referenced this issue Aug 3, 2022
I believe the races described in the issue have been fixed: we should
invalidate mod tidy results on any metadata change. If this invalidation
doesn't work due to a race, we want to know about it.

Update the test to wait for file-related events to complete before
removing files, in an attempt to avoid windows file-locking issues.

For golang/go#40269
For golang/go#53878

Change-Id: I91f0cb4969851010b34904a0b78ab9bd2808f92e
Reviewed-on: https://go-review.googlesource.com/c/tools/+/420718
Run-TryBot: Robert Findley <rfindley@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Suzy Mueller <suzmue@golang.org>
@findleyr findleyr modified the milestones: gopls/later, gopls/v0.10.0 Aug 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
gopls Testing Tools
Projects
None yet
Development

No branches or pull requests

2 participants