aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/go/testdata/script/README
diff options
context:
space:
mode:
authorBryan C. Mills <bcmills@google.com>2022-06-30 13:30:48 -0400
committerGopher Robot <gobot@golang.org>2022-06-30 18:10:53 +0000
commit84db00ffd1c0e11180fc433df1ef7521de37a49b (patch)
tree1a444337bb46b921e014f39a2ba21a7963f47547 /src/cmd/go/testdata/script/README
parent31b8c23c5702f129aca9241bbb2132c90b1929cc (diff)
downloadgo-84db00ffd1c0e11180fc433df1ef7521de37a49b.tar.gz
go-84db00ffd1c0e11180fc433df1ef7521de37a49b.zip
cmd/go: add a 'sleep' command for script tests
Due to mtime skew we don't index mutable packages with an mtime younger than 2 seconds. In order to test indexed packages reliably, we want to be able to sleep long enough for the files in the package to be cached. (As an alternative we could instead use os.Chtimes to fake old enough timestamps, but sleeping keeps the tests more realistic.) For #53586. Change-Id: I1873f47c55a72d928451593b8c989f0092a557db Reviewed-on: https://go-review.googlesource.com/c/go/+/415474 Auto-Submit: Bryan Mills <bcmills@google.com> Run-TryBot: Bryan Mills <bcmills@google.com> Reviewed-by: Russ Cox <rsc@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org>
Diffstat (limited to 'src/cmd/go/testdata/script/README')
-rw-r--r--src/cmd/go/testdata/script/README5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/cmd/go/testdata/script/README b/src/cmd/go/testdata/script/README
index 85e575d56e..c575bff1a5 100644
--- a/src/cmd/go/testdata/script/README
+++ b/src/cmd/go/testdata/script/README
@@ -176,6 +176,11 @@ The commands are:
- skip [message]
Mark the test skipped, including the message if given.
+- sleep duration
+ Sleep for the given duration (a time.Duration string).
+ (Tests should generally poll instead of sleeping, but sleeping may sometimes
+ be necessary, for example, to ensure that modified files have unique mtimes.)
+
- [!] stale path...
The packages named by the path arguments must (or must not)
be reported as "stale" by the go command.