-
-
Notifications
You must be signed in to change notification settings - Fork 7.5k
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
resources: BenchmarkResourcesMatch cannot run with -count=10 and crashes with an index out of range error #8981
Comments
I believe the reason for this failure is because the RNG is NOT SAFE for concurrent use yet the code uses pb.Next() which spins up goroutines to process concurrently, as documented https://pkg.go.dev/math/rand#NewSource per hugo/resources/resource_test.go Lines 192 to 198 in 13ad840
RemedyThe math/rand docs say that the default source is SAFE for concurrent usage so we could switch to that |
The source from NewSource is documented not to be safe for concurrency, and instead use the eefault source which is documented as safe. Fixes gohugoio#8981
The source from NewSource is documented not to be safe for concurrency, and instead use the eefault source which is documented as safe. Fixes #8981
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Noticed while testing out continuous benchmarking for Go on Hugo using our product "Bencher" if we look at https://dashboard.github.orijtech.com/benchmark/83306b009ae244afa735fa6cb31defda
and this crash is trivially reproducible by running
go test -run=^$ -bench=. -count=10 -benchmem
reproducible on Linux and Darwin.
Continuous benchmarking with bencher
Shameless plug We at Orijtech Inc are on a mission to bring high performance engineering to the doorstep of every programmer. Our product is currently focused on benchmarking for the Go programming language and we take away all the tedious error prone ergonomics of benchmarking, running your benchmarks on every push, doing the heavy lifting for you. The product is non-invasive and can be added as a Github app, available at the marketplace at https://github.com/marketplace/gobencher
The text was updated successfully, but these errors were encountered: