Skip to content

Commit

Permalink
fix flaky AlertEmail test
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanielc committed Jan 24, 2017
1 parent aa36ef4 commit 14e25fc
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions integrations/streamer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7608,6 +7608,8 @@ Value: 10

testStreamerNoOutput(t, "TestStream_Alert", script, 13*time.Second, tmInit)

// Close both client and server to ensure all message are processed
smtpService.Close()
smtpServer.Close()

errors := smtpServer.Errors()
Expand Down Expand Up @@ -8638,11 +8640,11 @@ func testStreamerNoOutput(
tmInit func(tm *kapacitor.TaskMaster),
) {
clock, et, replayErr, tm := testStreamer(t, name, script, tmInit)
defer tm.Close()
err := fastForwardTask(clock, et, replayErr, tm, duration)
if err != nil {
t.Error(err)
}
defer tm.Close()
}

func testStreamerWithOutput(
Expand All @@ -8655,11 +8657,12 @@ func testStreamerWithOutput(
tmInit func(tm *kapacitor.TaskMaster),
) {
clock, et, replayErr, tm := testStreamer(t, name, script, tmInit)
defer tm.Close()

err := fastForwardTask(clock, et, replayErr, tm, duration)
if err != nil {
t.Error(err)
}
defer tm.Close()

// Get the result
output, err := et.GetOutput(name)
Expand Down Expand Up @@ -8702,6 +8705,7 @@ func testStreamerWithSteppedOutput(
t.Skip("Test is not deterministic, need a mechanisim to safely step task execution.")
clock, et, replayErr, tm := testStreamer(t, name, script, tmInit)
defer tm.Close()

for s, step := range steps {
// Move time forward
clock.Set(clock.Zero().Add(step.t))
Expand Down

0 comments on commit 14e25fc

Please sign in to comment.