The test was reusing the same variable for the service on each iteration, the problem is that when the service creation fails, it clears out the variable and in the next iteration it panics because is trying to use a field on that same variable.