I have a code that looks like this, and when I run this locally, my unit tests pass (I ran it 100 times, and I get no error). However, this fails on Jenkins build everytime.