Add flag to rerun failed tests

This will catch failures before they are thrown and attempt to rerun the test 3 times. If it still fails after these 3 runs the failure will be thrown normally