-
Notifications
You must be signed in to change notification settings - Fork 491
Stress Test
Reed O'Brien edited this page Aug 19, 2016
·
3 revisions
#!/bin/bash
# run this script from the root of a package.
set -e
go test -c $*
PKG=$(basename $(pwd))
while true ; do
env GOMAXPROCS=$[ 1 + $[ RANDOM % 128 ]] ./$PKG.test $@ 2>&1
done
I've updated this to the following so I can see how long and how many times the test was run before triggering a race -- or failing to trigger ideally:)
#!/usr/bin/env bash
set -e
# go test -c
# comment above and uncomment below to enable the race builder
go test -c -race
PKG=$(basename $(pwd))
# Counter
C=0
START_TIME=$SECONDS
while true ; do
C=$((C+1))
export GOTRACEBACK=all
export GOMAXPROCS=$[ 1 + $[ RANDOM % 128 ]]
./$PKG.test $@ 2>&1
ELAPSED_TIME=$(($SECONDS - $START_TIME))
echo "$C successful runs in $(($ELAPSED_TIME/60)) min $(($ELAPSED_TIME%60)) sec"
done
Note: Many of these wiki pages are out-of-date. Please refer to the material at discourse.jujucharms.com, especially content within the Development category.
Testing
Releases
Documentation
Development
- READ BEFORE CODING
- Blocking bugs process
- Bug fixes and patching
- Contributing
- Code Review Checklists
- Creating New Repos
- MongoDB and Consistency
- Scripts
- Update Launchpad Dependency
- Writing workers
- Reviewboard Tips
Debugging and QA