Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
testing: add func AllocsPerRun(func()) #4461
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
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
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 ---.
This issue was closed.