github.com/juju/juju@v0.0.0-20240430160146-1752b71fcf00/testing/constants.go (about) 1 // Copyright 2012, 2013 Canonical Ltd. 2 // Licensed under the AGPLv3, see LICENCE file for details. 3 4 package testing 5 6 import ( 7 "time" 8 9 "github.com/juju/clock" 10 "github.com/juju/retry" 11 "github.com/juju/utils/v3" 12 ) 13 14 // ShortWait is a reasonable amount of time to block waiting for something that 15 // shouldn't actually happen. (as in, the test suite will *actually* wait this 16 // long before continuing) 17 const ShortWait = 50 * time.Millisecond 18 19 // LongWait is used when something should have already happened, or happens 20 // quickly, but we want to make sure we just haven't missed it. As in, the test 21 // suite should proceed without sleeping at all, but just in case. It is long 22 // so that we don't have spurious failures without actually slowing down the 23 // test suite 24 const LongWait = 10 * time.Second 25 26 // TODO(katco): 2016-08-09: lp:1611427 27 var LongAttempt = &utils.AttemptStrategy{ 28 Total: LongWait, 29 Delay: ShortWait, 30 } 31 32 var LongRetryStrategy = retry.CallArgs{ 33 Clock: clock.WallClock, 34 MaxDuration: LongWait, 35 Delay: ShortWait, 36 }