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

testing: add func AllocsPerRun(func()) #4461

Closed
gopherbot opened this issue Nov 28, 2012 · 8 comments
Closed

testing: add func AllocsPerRun(func()) #4461

gopherbot opened this issue Nov 28, 2012 · 8 comments
Labels
FrozenDueToAge Suggested Issues that may be good for new contributors looking for work to do.
Milestone

Comments

@gopherbot
Copy link

by jgrahamc:

Which operating system are you using?

FreeBSD amd64

Which version are you using?  (run 'go version')

go version devel +88e4ba173900

Please provide any additional information below.

When running ./all.bash to rebuild go after an hg sync I get the following test failures:

--- FAIL: TestChunkReaderAllocs (0.00 seconds)
chunked_test.go:67:             4 mallocs; want <= 1
FAIL
FAIL    net/http        2.417s
ok      net/http/cgi    0.437s
ok      net/http/fcgi   0.012s
ok      net/http/httptest       0.012s
--- FAIL: TestChunkReaderAllocs (0.00 seconds)
chunked_test.go:69:             4 mallocs; want <= 1
FAIL
FAIL    net/http/httputil       0.017s
@bradfitz
Copy link
Contributor

Comment 1:

I guess this is my fault, but I don't know why.
http://build.golang.org/ looks fine.
Which version of FreeBSD? (if that matters... maybe?)

Owner changed to @bradfitz.

Status changed to Accepted.

@gopherbot
Copy link
Author

Comment 2 by jgrahamc:

I don't know if the FreeBSD version matters but I am running:
$ uname -a
FreeBSD freebsd 9.0-RELEASE FreeBSD 9.0-RELEASE #0: Tue Jan  3 07:46:30 UTC 2012    
root@farrell.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC  amd64
Happy to help debug if there's something useful I can do.

@minux
Copy link
Member

minux commented Nov 29, 2012

Comment 3:

I use exactly this kernel, but unfortunately, I can't reproduce the test failure.

@davecheney
Copy link
Contributor

Comment 4:

I haven't been able to reproduce this yet, could those on freebsd systems please try
running this script over your lunch break.
There was a prior commit,
https://code.google.com/p/go/source/detail?r=1315abc581ed1d8aa7f3e12f8cd5f250099198cc,
which should have fixed this problem.
% cat stress.bash 
#!/bin/bash
set -e
while true ; do 
        export GOMAXPROCS=$[ 1 + $[ RANDOM % 128 ]]
        go test std
done

@rsc
Copy link
Contributor

rsc commented Dec 9, 2012

Comment 6:

The test looks broken to me. It runs a single iteration, but there can always be minor
first-use noise. It should do something like 10 or 100 iterations and divide by the
count to throw away the noise. 
Changing the bug to be about adding a function for counting mallocs to package testing.
The TestCountMallocs in package fmt is a good template.
Then we should use the function in this test and others.

Labels changed: added priority-later, removed priority-triage.

Owner changed to ---.

@rsc
Copy link
Contributor

rsc commented Dec 10, 2012

Comment 7:

Labels changed: added size-m.

@rsc
Copy link
Contributor

rsc commented Dec 10, 2012

Comment 8:

Labels changed: added suggested.

@rsc
Copy link
Contributor

rsc commented Feb 3, 2013

Comment 9:

This issue was closed by revision 9bfd3c3.

Status changed to Fixed.

@gopherbot gopherbot added fixed Suggested Issues that may be good for new contributors looking for work to do. labels Feb 3, 2013
@rsc rsc added this to the Go1.1 milestone Apr 14, 2015
@rsc rsc removed the go1.1 label Apr 14, 2015
@golang golang locked and limited conversation to collaborators Jun 24, 2016
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge Suggested Issues that may be good for new contributors looking for work to do.
Projects
None yet
Development

No branches or pull requests

5 participants