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

Commit

Permalink
Extend collection window from 10ms to 100ms to allow plugin to start …
Browse files Browse the repository at this point in the history
…up due to payload encryption key generation
  • Loading branch information
geauxvirtual committed Sep 30, 2015
1 parent 2174fa0 commit 250439b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions mgmt/rest/client/client_func_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -569,7 +569,7 @@ func TestPulseClient(t *testing.T) {
c.LoadPlugin(FILE_PLUGIN_PATH)

wf := getWMFromSample("1.json")
sch := &Schedule{Type: "simple", Interval: "10ms"}
sch := &Schedule{Type: "simple", Interval: "100ms"}
p := c.CreateTask(sch, wf, "baron", false)

a := make([]string, 0)
Expand All @@ -593,7 +593,7 @@ func TestPulseClient(t *testing.T) {
c.StopTask(p.ID)
c.StartTask(p.ID)
<-wait
So(len(a), ShouldBeGreaterThanOrEqualTo, 0)
So(len(a), ShouldEqual, 10)
So(a[0], ShouldEqual, "task-stopped")
So(a[1], ShouldEqual, "task-started")
for x := 2; x <= 9; x++ {
Expand Down
6 changes: 4 additions & 2 deletions mgmt/rest/rest_func_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ func watchTask(id, port int) *watchTaskResult {
ste := &rbody.StreamedTaskEvent{}
err := json.Unmarshal(line, ste)
if err != nil {
log.Fatal(err)
r.close()
return
}
Expand All @@ -134,6 +135,7 @@ func watchTask(id, port int) *watchTaskResult {
r.close()
return
case rbody.TaskWatchTaskStopped, rbody.TaskWatchTaskStarted, rbody.TaskWatchMetricEvent:
log.Info(ste.EventType)
r.eventChan <- ste.EventType
}
}
Expand Down Expand Up @@ -1023,7 +1025,7 @@ func TestPluginRestCalls(t *testing.T) {
uploadPlugin(FILE_PLUGIN_PATH, port)
uploadPlugin(PSUTIL_PLUGIN_PATH, port)

r1 := createTask("1.json", "xenu", "10ms", true, port)
r1 := createTask("1.json", "xenu", "100ms", true, port)
So(r1.Body, ShouldHaveSameTypeAs, new(rbody.AddScheduledTask))
plr1 := r1.Body.(*rbody.AddScheduledTask)

Expand Down Expand Up @@ -1052,7 +1054,7 @@ func TestPluginRestCalls(t *testing.T) {
}()
<-wait
stopTask(id, port)
So(len(events), ShouldBeGreaterThanOrEqualTo, 0)
So(len(events), ShouldEqual, 10)
So(events[0], ShouldEqual, "task-started")
for x := 1; x <= 9; x++ {
So(events[x], ShouldEqual, "metric-event")
Expand Down

0 comments on commit 250439b

Please sign in to comment.