Builds that fail in under a minute reattempted

Reattempts builds that fail in under a minute the first five times. Includes a few tests for the new behavior.