From 26dc82c746b183f39df5db90515aa3fe3931423e Mon Sep 17 00:00:00 2001 From: Nino Khodabandeh Date: Tue, 26 Apr 2016 12:23:22 -0700 Subject: [PATCH] Wait for done chan first before Cleanup --- tail_test.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tail_test.go b/tail_test.go index 61edab4..e9397c0 100644 --- a/tail_test.go +++ b/tail_test.go @@ -507,10 +507,9 @@ func (t TailTest) VerifyTailOutput(tail *Tail, lines []string) { } func (t TailTest) Cleanup(tail *Tail, stop bool) { - <-time.After(100 * time.Millisecond) + <-t.done if stop { tail.Stop() } tail.Cleanup() - <-t.done }