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