Index | Files

package cron

import ""

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.


Package Files


func Test Uses

func Test(t *testing.T, testFunc func() error)

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.

Package cron imports 4 packages (graph). Updated 2020-03-24. Refresh now. Tools for package owners.