cmd/internal/script/scripttest: deflake cmd/link and other testscript tests via a longer WaitDelay

Issue #76685 has many watchflakes reports that include the error
"WaitDelay expired before I/O complete", with the testscripts
in cmd/link contributing the highest volume there. #70356 also has
accumulated 40 or so similar "WaitDelay expired" watchflakes reports
for the cmd/compile testscripts.

I was able to manually reproduce some of these cmd/link flakes.

Currently, the default WaitDelay used by the scripttest package
is 100ms for the 'exec' and 'cc' commands. Empirically, this is
too short for many of the cmd/link testscript tests and likely
other users of the scripttest package.

This CL updates the scripttest package to use a longer WaitDelay for the
'exec' and 'cc' commands and use the same WaitDelay for the package's
'go' command.

This seems to eliminate these particular cmd/link flakes, or
at least reduce their frequency such that I no longer saw them.
I suspect this will also address all or large majority of the
cmd/compile flakes in #70356.

This is now closer to what cmd/go does for its "exec" testscript
command, including how this CL now aligns the WaitDelay more directly
with the context deadline. (Previously, the 'cc' and 'go' commands
here had fixed WaitDelays of 100ms and 60s respectively, but
neither was aligned with the grace period in the two step clean up
in ScriptTestContext. That function was modeled after cmd/go's
testscript harness, but the WaitDelay durations used did not match.
This CL now more closely follows cmd/go's approach.)

I'm optimistically marking #70356 and #68788 as fixed. I think this CL
addresses something wrong with the cmd/link and cmd/compile testscript
tests that was causing them to have these errors reported with high
frequency, though we could still observe a more general problem
that busy builders seem to more rarely have WaitDelay expired errors
across a variety of tests.

Fixes #70356
Fixes #68788
Updates #76685
Updates #79409

Change-Id: I1a9095624159f0c8dbec403b41f999489e222b88
Reviewed-on: https://go-review.googlesource.com/c/go/+/785722
Reviewed-by: Cherry Mui <cherryyz@google.com>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Michael Matloob <matloob@golang.org>
1 file changed
tree: 42a60b17476f6f84e3615e40dbc9be9582206d71
  1. .github/
  2. api/
  3. doc/
  4. lib/
  5. misc/
  6. src/
  7. test/
  8. .gitattributes
  9. .gitignore
  10. codereview.cfg
  11. CONTRIBUTING.md
  12. go.env
  13. LICENSE
  14. PATENTS
  15. README.md
  16. SECURITY.md
README.md

The Go Programming Language

Go is an open source programming language that makes it easy to build simple, reliable, and efficient software.

Gopher image Gopher image by Renee French, licensed under Creative Commons 4.0 Attribution license.

Our canonical Git repository is located at https://go.googlesource.com/go. There is a mirror of the repository at https://github.com/golang/go.

Unless otherwise noted, the Go source files are distributed under the BSD-style license found in the LICENSE file.

Download and Install

Binary Distributions

Official binary distributions are available at https://go.dev/dl/.

After downloading a binary release, visit https://go.dev/doc/install for installation instructions.

Install From Source

If a binary distribution is not available for your combination of operating system and architecture, visit https://go.dev/doc/install/source for source installation instructions.

Contributing

Go is the work of thousands of contributors. We appreciate your help!

To contribute, please read the contribution guidelines at https://go.dev/doc/contribute.

Note that the Go project uses the issue tracker for bug reports and proposals only. See https://go.dev/wiki/Questions for a list of places to ask questions about the Go language.