fix intermittent test failures from race cond
Merge pull request #188 from fourk/fix_intermittent_test_failures

Fix intermittent test failures from race condition