removed unwanted var
better function name - thanks @cyli
removed usage of unwanted var
use CheckFailure - thanks @cyli

instead of manual checking args by extracting it from mock.calls
tests added for random_interval