Codebase list golang-github-vbauerster-mpb / 5951a5f
refactoring: TestProgressShutdownsWithErrFiller Vladimir Bauer 3 years ago
1 changed file(s) with 6 addition(s) and 6 deletion(s). Raw diff Collapse all Expand all
196196 }),
197197 )
198198
199 for bar.IsRunning() {
200 time.Sleep(randomDuration(100 * time.Millisecond))
201 bar.Increment()
202 }
203
204 go p.Wait()
199 go func() {
200 for bar.IsRunning() {
201 bar.Increment()
202 }
203 }()
205204
206205 select {
207206 case <-shutdown:
211210 case <-time.After(timeout):
212211 t.Errorf("Progress didn't shutdown after %v", timeout)
213212 }
213 p.Wait()
214214 }
215215
216216 func randomDuration(max time.Duration) time.Duration {