fix how locks are created in tests