Fixed the tests

This commit is contained in:
Diptanu Choudhury 2015-11-02 15:04:04 -08:00
parent 7d301fb8b3
commit 02d70eb5be
1 changed files with 11 additions and 13 deletions

View File

@ -14,17 +14,8 @@ import (
)
var (
ErrNoLeader = fmt.Errorf("No cluster leader")
ErrNoRegionPath = fmt.Errorf("No path to region")
BatchJobRestartPolicy = RestartPolicy{
Delay: 15 * time.Second,
Attempts: 15,
}
ServiceJobRestartPolicy = RestartPolicy{
Delay: 15 * time.Second,
Attempts: 2,
Interval: 1 * time.Minute,
}
ErrNoLeader = fmt.Errorf("No cluster leader")
ErrNoRegionPath = fmt.Errorf("No path to region")
)
type MessageType uint8
@ -925,9 +916,16 @@ func (r *RestartPolicy) Validate() error {
func NewRestartPolicy(jobType string) *RestartPolicy {
switch jobType {
case JobTypeService:
return &ServiceJobRestartPolicy
return &RestartPolicy{
Delay: 15 * time.Second,
Attempts: 2,
Interval: 1 * time.Minute,
}
case JobTypeBatch:
return &BatchJobRestartPolicy
return &RestartPolicy{
Delay: 15 * time.Second,
Attempts: 15,
}
default:
return nil
}