Codebase list golang-github-vbauerster-mpb / 6180982
const timeout Vladimir Bauer 4 years ago
1 changed file(s) with 10 addition(s) and 6 deletion(s). Raw diff Collapse all Expand all
88
99 "github.com/vbauerster/mpb/v7"
1010 "github.com/vbauerster/mpb/v7/decor"
11 )
12
13 const (
14 timeout = 200 * time.Millisecond
1115 )
1216
1317 func init() {
3943 go p.Wait()
4044 select {
4145 case <-shutdown:
42 case <-time.After(150 * time.Millisecond):
43 t.Error("Progress didn't shutdown")
46 case <-time.After(timeout):
47 t.Errorf("Progress didn't shutdown after %v", timeout)
4448 }
4549 }
4650
8488 go p.Wait()
8589 select {
8690 case <-shutdown:
87 case <-time.After(150 * time.Millisecond):
88 t.Error("Progress didn't shutdown")
91 case <-time.After(timeout):
92 t.Errorf("Progress didn't shutdown after %v", timeout)
8993 }
9094 }
9195
109113 select {
110114 case <-done:
111115 p.Wait()
112 case <-time.After(150 * time.Millisecond):
116 case <-time.After(timeout):
113117 close(fail)
114118 }
115119 }()
117121 select {
118122 case <-shutdown:
119123 case <-fail:
120 t.Error("Progress didn't shutdown")
124 t.Errorf("Progress didn't shutdown after %v", timeout)
121125 }
122126 }
123127