-
Notifications
You must be signed in to change notification settings - Fork 18k
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: changes cause canceled diagnostics for files in unrelated packages #36144
Comments
This seems like a fairly deep-rooted problem. As I understand it, if we're diagnosing package A, and I edit a file in unrelated package B, we're going to cancel the first diagnostics run and then not re-diagnose A. The fact that it was a |
FWIW, this is now the main cause of test failures in the cc @findleyr |
This uber PR contains a number of changes to our testscript tests: * Drop all errlogmatch's looking for assertions where we really should not need them. Historically we needed these because the threading model of gopls was a bit broken. i.e. despite us notifying of a change to a file, unless we waited for diagnostics to be available then we couldn't guarantee that, for example, completions would be correct * Fix up all go.mod files to include go directives so that we don't fall foul of golang/go#36144 * Where we do require errlogmatch's, make sure we follow the existing semantics per golang/go#36243 and golang/go#36340 * Fix up some scripts so that we don't have initial errors in the file and hence don't need to soak up initial diagnostics * Use sleep $DEFAULT_ERRLOGMATCH_WAIT where we expect there to be no diagnostic errors * Only use errlogmatch on diagnostic publications where we need to know that a file has been opened, e.g. file watching, or where we need to soak up initial diagnostic notifications (see golang/go#36243) * Move all commented-out errlogmatch commands matching on the number of errors to the end of each script. We still can't enable these
This uber PR contains a number of changes to our testscript tests: * Drop all errlogmatch's looking for assertions where we really should not need them. Historically we needed these because the threading model of gopls was a bit broken. i.e. despite us notifying of a change to a file, unless we waited for diagnostics to be available then we couldn't guarantee that, for example, completions would be correct * Fix up all go.mod files to include go directives so that we don't fall foul of golang/go#36144 * Where we do require errlogmatch's, make sure we follow the existing semantics per golang/go#36243 and golang/go#36340 * Fix up some scripts so that we don't have initial errors in the file and hence don't need to soak up initial diagnostics * Use sleep $DEFAULT_ERRLOGMATCH_WAIT where we expect there to be no diagnostic errors * Only use errlogmatch on diagnostic publications where we need to know that a file has been opened, e.g. file watching, or where we need to soak up initial diagnostic notifications (see golang/go#36243) * Move all commented-out errlogmatch commands matching on the number of errors to the end of each script. We still can't enable these
This uber PR contains a number of changes to our testscript tests: * Drop all errlogmatch's looking for assertions where we really should not need them. Historically we needed these because the threading model of gopls was a bit broken. i.e. despite us notifying of a change to a file, unless we waited for diagnostics to be available then we couldn't guarantee that, for example, completions would be correct * Fix up all go.mod files to include go directives so that we don't fall foul of golang/go#36144 * Where we do require errlogmatch's, make sure we follow the existing semantics per golang/go#36243 and golang/go#36340 * Fix up some scripts so that we don't have initial errors in the file and hence don't need to soak up initial diagnostics * Use sleep $DEFAULT_ERRLOGMATCH_WAIT where we expect there to be no diagnostic errors * Only use errlogmatch on diagnostic publications where we need to know that a file has been opened, e.g. file watching, or where we need to soak up initial diagnostic notifications (see golang/go#36243) * Move all commented-out errlogmatch commands matching on the number of errors to the end of each script. We still can't enable these
This uber PR contains a number of changes to our testscript tests: * Drop all errlogmatch's looking for assertions where we really should not need them. Historically we needed these because the threading model of gopls was a bit broken. i.e. despite us notifying of a change to a file, unless we waited for diagnostics to be available then we couldn't guarantee that, for example, completions would be correct * Fix up all go.mod files to include go directives so that we don't fall foul of golang/go#36144 * Where we do require errlogmatch's, make sure we follow the existing semantics per golang/go#36243 and golang/go#36340 * Fix up some scripts so that we don't have initial errors in the file and hence don't need to soak up initial diagnostics * Use sleep $DEFAULT_ERRLOGMATCH_WAIT where we expect there to be no diagnostic errors * Only use errlogmatch on diagnostic publications where we need to know that a file has been opened, e.g. file watching, or where we need to soak up initial diagnostic notifications (see golang/go#36243) * Move all commented-out errlogmatch commands matching on the number of errors to the end of each script. We still can't enable these
This uber PR contains a number of changes to our testscript tests: * Drop all errlogmatch's looking for assertions where we really should not need them. Historically we needed these because the threading model of gopls was a bit broken. i.e. despite us notifying of a change to a file, unless we waited for diagnostics to be available then we couldn't guarantee that, for example, completions would be correct * Fix up all go.mod files to include go directives so that we don't fall foul of golang/go#36144 * Where we do require errlogmatch's, make sure we follow the existing semantics per golang/go#36243 and golang/go#36340 * Fix up some scripts so that we don't have initial errors in the file and hence don't need to soak up initial diagnostics * Use sleep $DEFAULT_ERRLOGMATCH_WAIT where we expect there to be no diagnostic errors * Only use errlogmatch on diagnostic publications where we need to know that a file has been opened, e.g. file watching, or where we need to soak up initial diagnostic notifications (see golang/go#36243) * Move all commented-out errlogmatch commands matching on the number of errors to the end of each script. We still can't enable these
This uber PR contains a number of changes to our testscript tests: * Drop all errlogmatch's looking for assertions where we really should not need them. Historically we needed these because the threading model of gopls was a bit broken. i.e. despite us notifying of a change to a file, unless we waited for diagnostics to be available then we couldn't guarantee that, for example, completions would be correct * Fix up all go.mod files to include go directives so that we don't fall foul of golang/go#36144 * Where we do require errlogmatch's, make sure we follow the existing semantics per golang/go#36243 and golang/go#36340 * Fix up some scripts so that we don't have initial errors in the file and hence don't need to soak up initial diagnostics * Use sleep $DEFAULT_ERRLOGMATCH_WAIT where we expect there to be no diagnostic errors * Only use errlogmatch on diagnostic publications where we need to know that a file has been opened, e.g. file watching, or where we need to soak up initial diagnostic notifications (see golang/go#36243) * Move all commented-out errlogmatch commands matching on the number of errors to the end of each script. We still can't enable these
This uber PR contains a number of changes to our testscript tests: * Drop all errlogmatch's looking for assertions where we really should not need them. Historically we needed these because the threading model of gopls was a bit broken. i.e. despite us notifying of a change to a file, unless we waited for diagnostics to be available then we couldn't guarantee that, for example, completions would be correct * Fix up all go.mod files to include go directives so that we don't fall foul of golang/go#36144 * Where we do require errlogmatch's, make sure we follow the existing semantics per golang/go#36243 and golang/go#36340 * Fix up some scripts so that we don't have initial errors in the file and hence don't need to soak up initial diagnostics * Use sleep $DEFAULT_ERRLOGMATCH_WAIT where we expect there to be no diagnostic errors * Only use errlogmatch on diagnostic publications where we need to know that a file has been opened, e.g. file watching, or where we need to soak up initial diagnostic notifications (see golang/go#36243) * Move all commented-out errlogmatch commands matching on the number of errors to the end of each script. We still can't enable these
This uber PR contains a number of changes to our testscript tests: * Drop all errlogmatch's looking for assertions where we really should not need them. Historically we needed these because the threading model of gopls was a bit broken. i.e. despite us notifying of a change to a file, unless we waited for diagnostics to be available then we couldn't guarantee that, for example, completions would be correct * Fix up all go.mod files to include go directives so that we don't fall foul of golang/go#36144 * Where we do require errlogmatch's, make sure we follow the existing semantics per golang/go#36243 and golang/go#36340 * Fix up some scripts so that we don't have initial errors in the file and hence don't need to soak up initial diagnostics * Use sleep $DEFAULT_ERRLOGMATCH_WAIT where we expect there to be no diagnostic errors * Only use errlogmatch on diagnostic publications where we need to know that a file has been opened, e.g. file watching, or where we need to soak up initial diagnostic notifications (see golang/go#36243) * Move all commented-out errlogmatch commands matching on the number of errors to the end of each script. We still can't enable these Add some initial tests that help to verify our expectations around diagnostics being published by gopls. Set GOPATH and GOCACHE consistently for the install testscript scripts to speed them up. Call t.Parallel in a couple of places to speed up the entire test run. Add a test (that is skipped) which capture the essence of golang/go#36144.
This uber PR contains a number of changes to our testscript tests: * Drop all errlogmatch's looking for assertions where we really should not need them. Historically we needed these because the threading model of gopls was a bit broken. i.e. despite us notifying of a change to a file, unless we waited for diagnostics to be available then we couldn't guarantee that, for example, completions would be correct * Fix up all go.mod files to include go directives so that we don't fall foul of golang/go#36144 * Where we do require errlogmatch's, make sure we follow the existing semantics per golang/go#36243 and golang/go#36340 * Fix up some scripts so that we don't have initial errors in the file and hence don't need to soak up initial diagnostics * Use sleep $DEFAULT_ERRLOGMATCH_WAIT where we expect there to be no diagnostic errors * Only use errlogmatch on diagnostic publications where we need to know that a file has been opened, e.g. file watching, or where we need to soak up initial diagnostic notifications (see golang/go#36243) * Move all commented-out errlogmatch commands matching on the number of errors to the end of each script. We still can't enable these Add some initial tests that help to verify our expectations around diagnostics being published by gopls. Set GOPATH and GOCACHE consistently for the install testscript scripts to speed them up. Call t.Parallel in a couple of places to speed up the entire test run. Add a test (that is skipped) which capture the essence of golang/go#36144.
This uber PR contains a number of changes to our testscript tests: * Drop all errlogmatch's looking for assertions where we really should not need them. Historically we needed these because the threading model of gopls was a bit broken. i.e. despite us notifying of a change to a file, unless we waited for diagnostics to be available then we couldn't guarantee that, for example, completions would be correct * Fix up all go.mod files to include go directives so that we don't fall foul of golang/go#36144 * Where we do require errlogmatch's, make sure we follow the existing semantics per golang/go#36243 and golang/go#36340 * Fix up some scripts so that we don't have initial errors in the file and hence don't need to soak up initial diagnostics * Use sleep $DEFAULT_ERRLOGMATCH_WAIT where we expect there to be no diagnostic errors * Only use errlogmatch on diagnostic publications where we need to know that a file has been opened, e.g. file watching, or where we need to soak up initial diagnostic notifications (see golang/go#36243) * Move all commented-out errlogmatch commands matching on the number of errors to the end of each script. We still can't enable these Add some initial tests that help to verify our expectations around diagnostics being published by gopls. Set GOPATH and GOCACHE consistently for the install testscript scripts to speed them up. Call t.Parallel in a couple of places to speed up the entire test run. Add a test (that is skipped) which capture the essence of golang/go#36144.
This uber PR contains a number of changes to our testscript tests: * Drop all errlogmatch's looking for assertions where we really should not need them. Historically we needed these because the threading model of gopls was a bit broken. i.e. despite us notifying of a change to a file, unless we waited for diagnostics to be available then we couldn't guarantee that, for example, completions would be correct * Fix up all go.mod files to include go directives so that we don't fall foul of golang/go#36144 * Where we do require errlogmatch's, make sure we follow the existing semantics per golang/go#36243 and golang/go#36340 * Fix up some scripts so that we don't have initial errors in the file and hence don't need to soak up initial diagnostics * Use sleep $DEFAULT_ERRLOGMATCH_WAIT where we expect there to be no diagnostic errors * Only use errlogmatch on diagnostic publications where we need to know that a file has been opened, e.g. file watching, or where we need to soak up initial diagnostic notifications (see golang/go#36243) * Move all commented-out errlogmatch commands matching on the number of errors to the end of each script. We still can't enable these Add some initial tests that help to verify our expectations around diagnostics being published by gopls. Set GOPATH and GOCACHE consistently for the install testscript scripts to speed them up. Call t.Parallel in a couple of places to speed up the entire test run. Add a test (that is skipped) which capture the essence of golang/go#36144.
This uber PR contains a number of changes to our testscript tests: * Drop all errlogmatch's looking for assertions where we really should not need them. Historically we needed these because the threading model of gopls was a bit broken. i.e. despite us notifying of a change to a file, unless we waited for diagnostics to be available then we couldn't guarantee that, for example, completions would be correct * Fix up all go.mod files to include go directives so that we don't fall foul of golang/go#36144 * Where we do require errlogmatch's, make sure we follow the existing semantics per golang/go#36243 and golang/go#36340 * Fix up some scripts so that we don't have initial errors in the file and hence don't need to soak up initial diagnostics * Use sleep $DEFAULT_ERRLOGMATCH_WAIT where we expect there to be no diagnostic errors * Only use errlogmatch on diagnostic publications where we need to know that a file has been opened, e.g. file watching, or where we need to soak up initial diagnostic notifications (see golang/go#36243) * Move all commented-out errlogmatch commands matching on the number of errors to the end of each script. We still can't enable these Add some initial tests that help to verify our expectations around diagnostics being published by gopls. Set GOPATH and GOCACHE consistently for the install testscript scripts to speed them up. Call t.Parallel in a couple of places to speed up the entire test run. Add a test (that is skipped) which capture the essence of golang/go#36144.
This uber PR contains a number of changes to our testscript tests: * Drop all errlogmatch's looking for assertions where we really should not need them. Historically we needed these because the threading model of gopls was a bit broken. i.e. despite us notifying of a change to a file, unless we waited for diagnostics to be available then we couldn't guarantee that, for example, completions would be correct * Fix up all go.mod files to include go directives so that we don't fall foul of golang/go#36144 * Where we do require errlogmatch's, make sure we follow the existing semantics per golang/go#36243 and golang/go#36340 * Fix up some scripts so that we don't have initial errors in the file and hence don't need to soak up initial diagnostics * Use sleep $DEFAULT_ERRLOGMATCH_WAIT where we expect there to be no diagnostic errors * Only use errlogmatch on diagnostic publications where we need to know that a file has been opened, e.g. file watching, or where we need to soak up initial diagnostic notifications (see golang/go#36243) * Move all commented-out errlogmatch commands matching on the number of errors to the end of each script. We still can't enable these Add some initial tests that help to verify our expectations around diagnostics being published by gopls. Set GOPATH and GOCACHE consistently for the install testscript scripts to speed them up. Call t.Parallel in a couple of places to speed up the entire test run. Add a test (that is skipped) which capture the essence of golang/go#36144.
This uber PR contains a number of changes to our testscript tests: * Drop all errlogmatch's looking for assertions where we really should not need them. Historically we needed these because the threading model of gopls was a bit broken. i.e. despite us notifying of a change to a file, unless we waited for diagnostics to be available then we couldn't guarantee that, for example, completions would be correct * Fix up all go.mod files to include go directives so that we don't fall foul of golang/go#36144 * Where we do require errlogmatch's, make sure we follow the existing semantics per golang/go#36243 and golang/go#36340 * Fix up some scripts so that we don't have initial errors in the file and hence don't need to soak up initial diagnostics * Use sleep $DEFAULT_ERRLOGMATCH_WAIT where we expect there to be no diagnostic errors * Only use errlogmatch on diagnostic publications where we need to know that a file has been opened, e.g. file watching, or where we need to soak up initial diagnostic notifications (see golang/go#36243) * Move all commented-out errlogmatch commands matching on the number of errors to the end of each script. We still can't enable these Add some initial tests that help to verify our expectations around diagnostics being published by gopls. Set GOPATH and GOCACHE consistently for the install testscript scripts to speed them up. Call t.Parallel in a couple of places to speed up the entire test run. Add a test (that is skipped) which capture the essence of golang/go#36144.
This uber PR contains a number of changes to our testscript tests: * Drop all errlogmatch's looking for assertions where we really should not need them. Historically we needed these because the threading model of gopls was a bit broken. i.e. despite us notifying of a change to a file, unless we waited for diagnostics to be available then we couldn't guarantee that, for example, completions would be correct * Fix up all go.mod files to include go directives so that we don't fall foul of golang/go#36144 * Where we do require errlogmatch's, make sure we follow the existing semantics per golang/go#36243 and golang/go#36340 * Fix up some scripts so that we don't have initial errors in the file and hence don't need to soak up initial diagnostics * Use sleep $DEFAULT_ERRLOGMATCH_WAIT where we expect there to be no diagnostic errors * Only use errlogmatch on diagnostic publications where we need to know that a file has been opened, e.g. file watching, or where we need to soak up initial diagnostic notifications (see golang/go#36243) * Move all commented-out errlogmatch commands matching on the number of errors to the end of each script. We still can't enable these Add some initial tests that help to verify our expectations around diagnostics being published by gopls. Set GOPATH and GOCACHE consistently for the install testscript scripts to speed them up. Call t.Parallel in a couple of places to speed up the entire test run. Add a test (that is skipped) which capture the essence of golang/go#36144.
This uber PR contains a number of changes to our testscript tests: * Drop all errlogmatch's looking for assertions where we really should not need them. Historically we needed these because the threading model of gopls was a bit broken. i.e. despite us notifying of a change to a file, unless we waited for diagnostics to be available then we couldn't guarantee that, for example, completions would be correct * Fix up all go.mod files to include go directives so that we don't fall foul of golang/go#36144 * Where we do require errlogmatch's, make sure we follow the existing semantics per golang/go#36243 and golang/go#36340 * Fix up some scripts so that we don't have initial errors in the file and hence don't need to soak up initial diagnostics * Use sleep $DEFAULT_ERRLOGMATCH_WAIT where we expect there to be no diagnostic errors * Only use errlogmatch on diagnostic publications where we need to know that a file has been opened, e.g. file watching, or where we need to soak up initial diagnostic notifications (see golang/go#36243) * Move all commented-out errlogmatch commands matching on the number of errors to the end of each script. We still can't enable these Add some initial tests that help to verify our expectations around diagnostics being published by gopls. Set GOPATH and GOCACHE consistently for the install testscript scripts to speed them up. Call t.Parallel in a couple of places to speed up the entire test run. Add a test (that is skipped) which capture the essence of golang/go#36144.
This uber PR contains a number of changes to our testscript tests: * Drop all errlogmatch's looking for assertions where we really should not need them. Historically we needed these because the threading model of gopls was a bit broken. i.e. despite us notifying of a change to a file, unless we waited for diagnostics to be available then we couldn't guarantee that, for example, completions would be correct * Fix up all go.mod files to include go directives so that we don't fall foul of golang/go#36144 * Where we do require errlogmatch's, make sure we follow the existing semantics per golang/go#36243 and golang/go#36340 * Fix up some scripts so that we don't have initial errors in the file and hence don't need to soak up initial diagnostics * Use sleep $DEFAULT_ERRLOGMATCH_WAIT where we expect there to be no diagnostic errors * Only use errlogmatch on diagnostic publications where we need to know that a file has been opened, e.g. file watching, or where we need to soak up initial diagnostic notifications (see golang/go#36243) * Move all commented-out errlogmatch commands matching on the number of errors to the end of each script. We still can't enable these Add some initial tests that help to verify our expectations around diagnostics being published by gopls. Set GOPATH and GOCACHE consistently for the install testscript scripts to speed them up. Call t.Parallel in a couple of places to speed up the entire test run. Add a test (that is skipped) which capture the essence of golang/go#36144.
This uber PR contains a number of changes to our testscript tests: * Drop all errlogmatch's looking for assertions where we really should not need them. Historically we needed these because the threading model of gopls was a bit broken. i.e. despite us notifying of a change to a file, unless we waited for diagnostics to be available then we couldn't guarantee that, for example, completions would be correct * Fix up all go.mod files to include go directives so that we don't fall foul of golang/go#36144 * Where we do require errlogmatch's, make sure we follow the existing semantics per golang/go#36243 and golang/go#36340 * Fix up some scripts so that we don't have initial errors in the file and hence don't need to soak up initial diagnostics * Use sleep $DEFAULT_ERRLOGMATCH_WAIT where we expect there to be no diagnostic errors * Only use errlogmatch on diagnostic publications where we need to know that a file has been opened, e.g. file watching, or where we need to soak up initial diagnostic notifications (see golang/go#36243) * Move all commented-out errlogmatch commands matching on the number of errors to the end of each script. We still can't enable these Add some initial tests that help to verify our expectations around diagnostics being published by gopls. Set GOPATH and GOCACHE consistently for the install testscript scripts to speed them up. Call t.Parallel in a couple of places to speed up the entire test run. Add a test (that is skipped) which capture the essence of golang/go#36144.
This uber PR contains a number of changes to our testscript tests: * Drop all errlogmatch's looking for assertions where we really should not need them. Historically we needed these because the threading model of gopls was a bit broken. i.e. despite us notifying of a change to a file, unless we waited for diagnostics to be available then we couldn't guarantee that, for example, completions would be correct * Fix up all go.mod files to include go directives so that we don't fall foul of golang/go#36144 * Where we do require errlogmatch's, make sure we follow the existing semantics per golang/go#36243 and golang/go#36340 * Fix up some scripts so that we don't have initial errors in the file and hence don't need to soak up initial diagnostics * Use sleep $DEFAULT_ERRLOGMATCH_WAIT where we expect there to be no diagnostic errors * Only use errlogmatch on diagnostic publications where we need to know that a file has been opened, e.g. file watching, or where we need to soak up initial diagnostic notifications (see golang/go#36243) * Move all commented-out errlogmatch commands matching on the number of errors to the end of each script. We still can't enable these Add some initial tests that help to verify our expectations around diagnostics being published by gopls. Set GOPATH and GOCACHE consistently for the install testscript scripts to speed them up. Call t.Parallel in a couple of places to speed up the entire test run. Add a test (that is skipped) which capture the essence of golang/go#36144.
This uber PR contains a number of changes to our testscript tests: * Drop all errlogmatch's looking for assertions where we really should not need them. Historically we needed these because the threading model of gopls was a bit broken. i.e. despite us notifying of a change to a file, unless we waited for diagnostics to be available then we couldn't guarantee that, for example, completions would be correct * Fix up all go.mod files to include go directives so that we don't fall foul of golang/go#36144 * Where we do require errlogmatch's, make sure we follow the existing semantics per golang/go#36243 and golang/go#36340 * Fix up some scripts so that we don't have initial errors in the file and hence don't need to soak up initial diagnostics * Use sleep $DEFAULT_ERRLOGMATCH_WAIT where we expect there to be no diagnostic errors * Only use errlogmatch on diagnostic publications where we need to know that a file has been opened, e.g. file watching, or where we need to soak up initial diagnostic notifications (see golang/go#36243) * Move all commented-out errlogmatch commands matching on the number of errors to the end of each script. We still can't enable these Add some initial tests that help to verify our expectations around diagnostics being published by gopls. Set GOPATH and GOCACHE consistently for the install testscript scripts to speed them up. Call t.Parallel in a couple of places to speed up the entire test run. Add a test (that is skipped) which capture the essence of golang/go#36144.
This uber PR contains a number of changes to our testscript tests: * Drop all errlogmatch's looking for assertions where we really should not need them. Historically we needed these because the threading model of gopls was a bit broken. i.e. despite us notifying of a change to a file, unless we waited for diagnostics to be available then we couldn't guarantee that, for example, completions would be correct * Fix up all go.mod files to include go directives so that we don't fall foul of golang/go#36144 * Where we do require errlogmatch's, make sure we follow the existing semantics per golang/go#36243 and golang/go#36340 * Fix up some scripts so that we don't have initial errors in the file and hence don't need to soak up initial diagnostics * Use sleep $DEFAULT_ERRLOGMATCH_WAIT where we expect there to be no diagnostic errors * Only use errlogmatch on diagnostic publications where we need to know that a file has been opened, e.g. file watching, or where we need to soak up initial diagnostic notifications (see golang/go#36243) * Move all commented-out errlogmatch commands matching on the number of errors to the end of each script. We still can't enable these Add some initial tests that help to verify our expectations around diagnostics being published by gopls. Set GOPATH and GOCACHE consistently for the install testscript scripts to speed them up. Call t.Parallel in a couple of places to speed up the entire test run. Add a test (that is skipped) which capture the essence of golang/go#36144.
This uber PR contains a number of changes to our testscript tests: * Drop all errlogmatch's looking for assertions where we really should not need them. Historically we needed these because the threading model of gopls was a bit broken. i.e. despite us notifying of a change to a file, unless we waited for diagnostics to be available then we couldn't guarantee that, for example, completions would be correct * Fix up all go.mod files to include go directives so that we don't fall foul of golang/go#36144 * Where we do require errlogmatch's, make sure we follow the existing semantics per golang/go#36243 and golang/go#36340 * Fix up some scripts so that we don't have initial errors in the file and hence don't need to soak up initial diagnostics * Use sleep $DEFAULT_ERRLOGMATCH_WAIT where we expect there to be no diagnostic errors * Only use errlogmatch on diagnostic publications where we need to know that a file has been opened, e.g. file watching, or where we need to soak up initial diagnostic notifications (see golang/go#36243) * Move all commented-out errlogmatch commands matching on the number of errors to the end of each script. We still can't enable these Add some initial tests that help to verify our expectations around diagnostics being published by gopls. Set GOPATH and GOCACHE consistently for the install testscript scripts to speed them up. Call t.Parallel in a couple of places to speed up the entire test run. Add a test (that is skipped) which capture the essence of golang/go#36144.
This uber PR contains a number of changes to our testscript tests: * Drop all errlogmatch's looking for assertions where we really should not need them. Historically we needed these because the threading model of gopls was a bit broken. i.e. despite us notifying of a change to a file, unless we waited for diagnostics to be available then we couldn't guarantee that, for example, completions would be correct * Fix up all go.mod files to include go directives so that we don't fall foul of golang/go#36144 * Where we do require errlogmatch's, make sure we follow the existing semantics per golang/go#36243 and golang/go#36340 * Fix up some scripts so that we don't have initial errors in the file and hence don't need to soak up initial diagnostics * Use sleep $DEFAULT_ERRLOGMATCH_WAIT where we expect there to be no diagnostic errors * Only use errlogmatch on diagnostic publications where we need to know that a file has been opened, e.g. file watching, or where we need to soak up initial diagnostic notifications (see golang/go#36243) * Move all commented-out errlogmatch commands matching on the number of errors to the end of each script. We still can't enable these Add some initial tests that help to verify our expectations around diagnostics being published by gopls. Set GOPATH and GOCACHE consistently for the install testscript scripts to speed them up. Call t.Parallel in a couple of places to speed up the entire test run. Add a test (that is skipped) which capture the essence of golang/go#36144.
@stamblerre I'm minded to close this given the massive number of updates recently, unless you/@heschik would like to keep it open? |
FWIW I'm re-enabling a test against current master to stress this out a bit: govim/govim#684 |
Yes, I think it's reasonable to close this now that we diagnose entire workspace on every file change. Even if one diagnostics run gets canceled, another one will immediately be started and will complete once the user stops typing. |
Sounds good. Please follow up here once you get a chance to test this. |
This does indeed appear to be fixed now; we at least have a passing CI! If we see any further issues we can re-open/create a new issue. Thanks again for all the work on fixes @stamblerre! |
What version of Go are you using (
go version
)?Note this version is a temporary fork with fixes as described in #35638 (comment)
Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
We have a
govim
test that starts by opening a file and then callingFormatting
.But before calling
Formatting
we first wait for the initial diagnostics to be sent for the file.However very occasionally we do not see the initial diagnostics for the file and the test times out (and fails) waiting.
Here is a failing and passing log of this test:
On the occasions that this test fails, changes to
go.mod
appear to be related.govim
currently supports file watching by simulating the file that has changed being open in the editor. For example, withgo.mod
changes,govim
detects the file has changed, signalsDidOpen
togopls
on the first change, thenDidChange
thereafter.As you can see from the failing log above, the calculation of diagnostics for
file.go
gets almost to the point of publishing, but then its context gets cancelled. That in itself isn't a problem except that the diagnostics are not subsequently sent.What did you expect to see?
Initial diagnostics to be sent for a file.
What did you see instead?
As above.
cc @stamblerre @heschik @ridersofrohan
The text was updated successfully, but these errors were encountered: