Example #1
0
func (*retrySuite) TestCallArgsDefaults(c *gc.C) {
	// BackoffFactor is one of the two values with reasonable
	// defaults, and the default is linear if not specified.
	// The other default is the Clock. If not specified, it is the
	// wall clock.
	args := retry.CallArgs{
		Func:     func() error { return errors.New("bah") },
		Attempts: 5,
		Delay:    time.Minute,
	}

	err := args.Validate()
	c.Assert(err, jc.ErrorIsNil)
	c.Assert(args.BackoffFactor, gc.Equals, float64(1))
	c.Assert(args.Clock, gc.Equals, clock.WallClock)
}