This issue happens when some environment doesn't set. Do you verify all settings that your code needs to run the test?