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/nm: short tests are not short enough #26471

Closed
rsc opened this Issue Jul 19, 2018 · 3 comments

Comments

Projects
None yet
5 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/nm test takes 6.4s on my system, which seems crazy. Can we make it take less time? If it's compiling a binary to run nm on, it seems like it would work fine to use any existing binary, like $GOROOT/bin/go.

/cc @aclements

@shivakumargn

This comment has been minimized.

Contributor

shivakumargn commented Jul 27, 2018

On my system (linux/amd64) it runs in 1.677s. Am I missing something?

> go test cmd/nm -v
=== RUN   TestInternalLinkerCgoExec
--- PASS: TestInternalLinkerCgoExec (0.35s)
=== RUN   TestExternalLinkerCgoExec
--- PASS: TestExternalLinkerCgoExec (0.46s)
=== RUN   TestCgoLib
--- PASS: TestCgoLib (0.18s)
=== RUN   TestNonGoExecs
--- PASS: TestNonGoExecs (0.02s)
=== RUN   TestGoExec
--- PASS: TestGoExec (0.24s)
=== RUN   TestGoLib
--- PASS: TestGoLib (0.02s)
PASS
ok  	cmd/nm	1.677s
@ysmolsky

This comment has been minimized.

Member

ysmolsky commented Sep 18, 2018

Just tested tip on my slow Mac:

~/golang/src (master $=) % go test cmd/nm -v -short
=== RUN   TestInternalLinkerCgoExec
--- PASS: TestInternalLinkerCgoExec (0.57s)
=== RUN   TestExternalLinkerCgoExec
--- PASS: TestExternalLinkerCgoExec (0.87s)
=== RUN   TestCgoLib
--- PASS: TestCgoLib (0.38s)
=== RUN   TestNonGoExecs
--- PASS: TestNonGoExecs (0.04s)
=== RUN   TestGoExec
--- PASS: TestGoExec (0.33s)
=== RUN   TestGoLib
--- PASS: TestGoLib (0.04s)
PASS
ok  	cmd/nm	2.716s

What target time are we trying to achieve?

@gopherbot

This comment has been minimized.

gopherbot commented Dec 10, 2018

Change https://golang.org/cl/153499 mentions this issue: cmd/nm: run tests in parallel, don't use Scanner on []byte

@gopherbot gopherbot closed this in 9b95035 Dec 11, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment