Skip to content

Commit

Permalink
scheduler: reenable TestPlugin_LifeCycle, increase timeouts
Browse files Browse the repository at this point in the history
  • Loading branch information
Sergiusz Urbaniak committed Sep 30, 2015
1 parent 28d7141 commit 56fc0f5
Show file tree
Hide file tree
Showing 2 changed files with 283 additions and 120 deletions.
11 changes: 8 additions & 3 deletions contrib/mesos/pkg/scheduler/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,11 @@ const (
pluginRecoveryDelay = 100 * time.Millisecond // delay after scheduler plugin crashes, before we resume scheduling
)

const (
FailedScheduling = "FailedScheduling"
Scheduled = "Scheduled"
)

// scheduler abstraction to allow for easier unit testing
type schedulerInterface interface {
sync.Locker // synchronize scheduler plugin operations
Expand Down Expand Up @@ -757,7 +762,7 @@ func (s *schedulingPlugin) scheduleOne() {
dest, err := s.config.Algorithm.Schedule(pod, s.config.NodeLister) // call kubeScheduler.Schedule
if err != nil {
log.V(1).Infof("Failed to schedule: %+v", pod)
s.config.Recorder.Eventf(pod, "FailedScheduling", "Error scheduling: %v", err)
s.config.Recorder.Eventf(pod, FailedScheduling, "Error scheduling: %v", err)
s.config.Error(pod, err)
return
}
Expand All @@ -770,11 +775,11 @@ func (s *schedulingPlugin) scheduleOne() {
}
if err := s.config.Binder.Bind(b); err != nil {
log.V(1).Infof("Failed to bind pod: %+v", err)
s.config.Recorder.Eventf(pod, "FailedScheduling", "Binding rejected: %v", err)
s.config.Recorder.Eventf(pod, FailedScheduling, "Binding rejected: %v", err)
s.config.Error(pod, err)
return
}
s.config.Recorder.Eventf(pod, "Scheduled", "Successfully assigned %v to %v", pod.Name, dest)
s.config.Recorder.Eventf(pod, Scheduled, "Successfully assigned %v to %v", pod.Name, dest)
}

// this pod may be out of sync with respect to the API server registry:
Expand Down
Loading

0 comments on commit 56fc0f5

Please sign in to comment.