add failing test case

This commit is contained in:
Sridhar Ratnakumar 2014-04-28 14:46:42 -07:00
parent 734bf58f78
commit afbbb638b5
1 changed files with 8 additions and 2 deletions

View File

@ -265,16 +265,22 @@ func TestRateLimiting(_t *testing.T) {
LimitRate: 2} LimitRate: 2}
expecting := "Too much log activity (more than 2 lines per second being written); waiting a second before resuming tailing" expecting := "Too much log activity (more than 2 lines per second being written); waiting a second before resuming tailing"
tail := t.StartTail("test.txt", config) tail := t.StartTail("test.txt", config)
// TODO: also verify that tail resumes after the cooloff period. // TODO: also verify that tail resumes after the cooloff period.
go t.VerifyTailOutput( go t.VerifyTailOutput(
tail, tail,
[]string{"hello", "world", "again", expecting}) []string{"hello", "world", "again", expecting, "more", "data"})
// Add more data only after reasonable delay.
<-time.After(1200 * time.Millisecond)
t.AppendFile("test.txt", "more\ndata\n")
// Delete after a reasonable delay, to give tail sufficient time // Delete after a reasonable delay, to give tail sufficient time
// to read all lines. // to read all lines.
<-time.After(100 * time.Millisecond) <-time.After(100 * time.Millisecond)
t.RemoveFile("test.txt") t.RemoveFile("test.txt")
tail.Stop()
// tail.Stop()
Cleanup() Cleanup()
} }