Skip to content
This repository has been archived by the owner on Nov 8, 2022. It is now read-only.

Commit

Permalink
try to fix the test failure in travis
Browse files Browse the repository at this point in the history
  • Loading branch information
candysmurf authored and jcooklin committed Feb 18, 2016
1 parent cd9252d commit 61984a5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion control/available_plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ func (a *availablePlugin) CheckHealth() {
} else {
a.healthCheckFailed()
}
case <-time.After(time.Second * 1):
case <-time.After(DefaultHealthCheckTimeout):
a.healthCheckFailed()
}
}
Expand Down
7 changes: 3 additions & 4 deletions control/control_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1134,7 +1134,7 @@ func TestFailedPlugin(t *testing.T) {
var err []error
var cr []core.Metric
eventMap := map[string]int{}
for i := 0; i <= MaxPluginRestartCount; i++ {
for i := 0; i < MaxPluginRestartCount+1; i++ {
cr, err = c.CollectMetrics(m, time.Now().Add(time.Second*1), uuid.New())
So(err, ShouldNotBeNil)
So(cr, ShouldBeNil)
Expand All @@ -1145,13 +1145,12 @@ func TestFailedPlugin(t *testing.T) {
<-lpe.done
eventMap[lpe.plugin.EventNamespace]++
So(pool.RestartCount(), ShouldEqual, i+1)
So(lpe.plugin.EventNamespace, ShouldEqual, control_event.AvailablePluginRestarted)
}
}
<-lpe.done
eventMap[lpe.plugin.EventNamespace]++
So(eventMap[control_event.AvailablePluginDead], ShouldEqual, MaxPluginRestartCount+1)
So(lpe.plugin.EventNamespace, ShouldEqual, control_event.PluginRestartsExceeded)
So(eventMap[control_event.AvailablePluginRestarted], ShouldEqual, MaxPluginRestartCount)
So(eventMap[control_event.PluginRestartsExceeded], ShouldEqual, 1)
So(len(pool.Plugins()), ShouldEqual, 0)
So(pool.RestartCount(), ShouldEqual, MaxPluginRestartCount)
})
Expand Down

0 comments on commit 61984a5

Please sign in to comment.