Skip to content
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
Closed

cmd/nm: short tests are not short enough #26471

rsc opened this issue Jul 19, 2018 · 3 comments
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. Testing An issue that has been verified to require only test changes, not just a test failure.
Milestone

Comments

@rsc
Copy link
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

@rsc rsc added this to the Go1.12 milestone Jul 19, 2018
@bcmills bcmills added Testing An issue that has been verified to require only test changes, not just a test failure. NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. labels Jul 19, 2018
@shivakumargn
Copy link
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

@ysmolski
Copy link
Member

ysmolski 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
Copy link

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

@golang golang locked and limited conversation to collaborators Dec 11, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. Testing An issue that has been verified to require only test changes, not just a test failure.
Projects
None yet
Development

No branches or pull requests

5 participants