diff --git a/progress_test.go b/progress_test.go index e25925e..2e6befd 100644 --- a/progress_test.go +++ b/progress_test.go @@ -9,6 +9,10 @@ "github.com/vbauerster/mpb/v7" "github.com/vbauerster/mpb/v7/decor" +) + +const ( + timeout = 200 * time.Millisecond ) func init() { @@ -40,8 +44,8 @@ go p.Wait() select { case <-shutdown: - case <-time.After(150 * time.Millisecond): - t.Error("Progress didn't shutdown") + case <-time.After(timeout): + t.Errorf("Progress didn't shutdown after %v", timeout) } } @@ -85,8 +89,8 @@ go p.Wait() select { case <-shutdown: - case <-time.After(150 * time.Millisecond): - t.Error("Progress didn't shutdown") + case <-time.After(timeout): + t.Errorf("Progress didn't shutdown after %v", timeout) } } @@ -110,7 +114,7 @@ select { case <-done: p.Wait() - case <-time.After(150 * time.Millisecond): + case <-time.After(timeout): close(fail) } }() @@ -118,7 +122,7 @@ select { case <-shutdown: case <-fail: - t.Error("Progress didn't shutdown") + t.Errorf("Progress didn't shutdown after %v", timeout) } }