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

cmd/go: short tests are not short enough #26472

Open
rsc opened this Issue Jul 19, 2018 · 6 comments

Comments

Projects
None yet
6 participants
@rsc
Contributor

rsc commented Jul 19, 2018

Running all.bash (which does go test -short std cmd), my target is usually that individual tests should run in under 1 second.

The cmd/go tests will never reach this target - cmd/go does more than perhaps the entire standard library combined, so it's fine to take more than 1 second. But my usual target is to keep it below 30s, if not 20s. Right now it's at 76s. We should keep bringing that down.

Converting more tests to scripts may help.

@iamoryanmoshe

This comment has been minimized.

Contributor

iamoryanmoshe commented Jul 22, 2018

Would love to give it a shot, can you please explain what

Converting more tests to scripts

Mean?

@bcmills

This comment has been minimized.

Member

bcmills commented Jul 23, 2018

See src/cmd/go/testdata/script.

(The .txt files are pretty self-explanatory, but the README contains more detail about the format and supported commands.)

@shivakumargn

This comment has been minimized.

Contributor

shivakumargn commented Jul 29, 2018

There are several cmd/go tests in go_test.go. Will submit CL for three of the most time consuming tests listed below. Additionally, will make them non-short.

TestCpuprofileTwice (8.55s)
TestCoverpkgAllRuntime (27.87s)
TestAtomicCoverpkgAll (28.72s)
@gopherbot

This comment has been minimized.

gopherbot commented Jul 29, 2018

Change https://golang.org/cl/126636 mentions this issue: cmd/go: 3 cmd/go tests (>8s) made as non-short scripts

@iWdGo

This comment has been minimized.

Contributor

iWdGo commented Aug 2, 2018

cmd/go times out on my Windows 10 but I noticed that -vet off could be set. During distribution, running vet has limited value and it is tested separately anyway. The fix seems elementary.
Added:
Recently added GOFLAGS allows to set vet off everywhere if needed: GOFLAGS=-vet=off
No fix needed.

@gopherbot

This comment has been minimized.

gopherbot commented Aug 2, 2018

Change https://golang.org/cl/127542 mentions this issue: cmd/dist: removing vet during testing of build

gopherbot pushed a commit that referenced this issue Aug 7, 2018

cmd/go: 3 cmd/go tests (>8s) made as non-short scripts
* TestAtomicCoverpkgAll -> Script/cover_atomic_pkgall.txt and make it
* non-short
* TestCoverpkgAllRuntime -> Script/cover_pkgall_runtime.txt and make it
* non-short
* TestCpuprofileTwice -> Script/cpu_profile_twice.txt and make it
* non-short
* TestGoTestMainTwice -> make it non-short

Updates #26472

Change-Id: I24f3d4c2a8b6e317adb369a1b1426e693f9571ed
Reviewed-on: https://go-review.googlesource.com/126636
Reviewed-by: Bryan C. Mills <bcmills@google.com>
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment