Package cron provides a function to run a test only in Travis CI cron runs, and retry the test with increasing delays a few times before failing the build.
The primary purpose of this method is to allow cron test that are non-hermetic and run against live (usually http) endpoints. Since the live endpoints could occasionally throw errors, there is built-in retry with delays between attempts.
Test runs a test if running in the CI's cron mode. It handles retries if the test returns an error, but passes through failures to the test suite. This allows the test function to retry by returning transient errors, while not wasting attempts on non-retryable failures.