fix issue #34
Add stepDefs mutex and lock in appropriate places to prevent races.
Enables a test to be switched back to use the default parallel = true flag, the example api and hooks tests still fail with parallelization, but after looking it seems that's an issue with how they were written (using package global variables) rather than a bug with concurrent execution.
#34
Thanks for your contribution @pauleibye ! Have you run tests with the
-raceflag on this branch? When I checkout this branch locally and rungo test ./... -race, I'm still getting race errors.
that's a good point, no I was not. This commit did fix the race conditions in our codebase, and our test suite uses the race flag. The test that I removed the NonParallel option from might be the problem still.
edit: it looks like the race happens in simple_test.go, which might be expected given that this test uses a global that the cases all try to overwrite.
reverted simple_test.go to main, which sets the non parallel flag on the non pointer test since it relies on overwriting a shared variable in a specific order
I'm still getting race errors locally. I'm going to look at this a bit and see if I can figure out what's going on.