Skip to content

Instantly share code, notes, and snippets.

@ef2k
Created September 24, 2014 15:16
Show Gist options
  • Select an option

  • Save ef2k/f419d56a3c979948bad5 to your computer and use it in GitHub Desktop.

Select an option

Save ef2k/f419d56a3c979948bad5 to your computer and use it in GitHub Desktop.
Stress Test Script for Golang
#!/usr/bin/env bash -e
# Cool stuff from http://dave.cheney.net/2013/06/19/stress-test-your-go-packages
go test -c
# comment above and uncomment below to enable the race builder
# go test -c -race
PKG=$(basename $(pwd))
while true ; do
export GOMAXPROCS=$[ 1 + $[ RANDOM % 128 ]]
./$PKG.test $@ 2>&1
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment