mirror of https://github.com/hashicorp/consul
Merge pull request #3873 from hashicorp/travis-redux
Makes Travis build a little more reliable.pull/3878/head
commit
3a49730503
|
@ -8,6 +8,6 @@ branches:
|
||||||
- master
|
- master
|
||||||
|
|
||||||
script:
|
script:
|
||||||
- make test
|
- GOTEST_FLAGS="-p 2 -parallel 2" make test
|
||||||
|
|
||||||
sudo: false
|
sudo: false
|
||||||
|
|
|
@ -82,7 +82,7 @@ func decorate(s string) string {
|
||||||
}
|
}
|
||||||
|
|
||||||
func Run(t Failer, f func(r *R)) {
|
func Run(t Failer, f func(r *R)) {
|
||||||
run(TwoSeconds(), t, f)
|
run(DefaultFailer(), t, f)
|
||||||
}
|
}
|
||||||
|
|
||||||
func RunWith(r Retryer, t Failer, f func(r *R)) {
|
func RunWith(r Retryer, t Failer, f func(r *R)) {
|
||||||
|
@ -133,6 +133,11 @@ func run(r Retryer, t Failer, f func(r *R)) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// DefaultFailer provides default retry.Run() behavior for unit tests.
|
||||||
|
func DefaultFailer() *Timer {
|
||||||
|
return &Timer{Timeout: 7 * time.Second, Wait: 25 * time.Millisecond}
|
||||||
|
}
|
||||||
|
|
||||||
// TwoSeconds repeats an operation for two seconds and waits 25ms in between.
|
// TwoSeconds repeats an operation for two seconds and waits 25ms in between.
|
||||||
func TwoSeconds() *Timer {
|
func TwoSeconds() *Timer {
|
||||||
return &Timer{Timeout: 2 * time.Second, Wait: 25 * time.Millisecond}
|
return &Timer{Timeout: 2 * time.Second, Wait: 25 * time.Millisecond}
|
||||||
|
|
Loading…
Reference in New Issue