Open aidagha opened 3 years ago
The library itself handles this, so it must be something in how we use it.
https://github.com/cheggaaa/pb/blob/master/example_multiple_test.go
First 98 / 200 [=======================>-----------------------] 49.00% 00m04s
Second 94 / 200 [=====================>------------------------] 47.00% 00m05s
Third 89 / 200 [====================>--------------------------] 44.50% 00m05s
I suspect if we turn on the setting that when the progress bar is 100% to hide itself it will fix this issue
another thing is that we continue to show progress bar even when progress is 100% already
seems like we the source of the problem is we create two independent pb
p := pb.Full.Start64(0)
and the other one in
https://github.com/medyagh/minikube/blob/b45c782df392d90613d6e8bcc94e029cd13128bb/pkg/minikube/download/progressbar.go#L49
should be using a Pool like the example in this issue https://github.com/cheggaaa/pb/issues/31#issuecomment-615189101
pool := &pb.Pool{}
first := pb.New(1000).Prefix("First ")
second := pb.New(1000).Prefix("Second ")
third := pb.New(1000).Prefix("Third ")
pool.Add(first, second, third)
pool.Start()
wg := new(sync.WaitGroup)
for _, bar := range []*pb.ProgressBar{first, second, third} {
wg.Add(1)
go func(cb *pb.ProgressBar) {
for n := 0; n < 1000; n++ {
cb.Increment()
time.Sleep(time.Millisecond * time.Duration(rand.Intn(100)))
}
cb.Finish()
wg.Done()
}(bar)
}
wg.Wait()
what we could do is adding a Global PB Pool in download package and any new PB be added to the pool
CC @andriyDev
Ah seems like V3 does NOT have pooling feature https://github.com/cheggaaa/pb/issues/166#issuecomment-682400009
We could look into downgrading to v1 to see what happens.
cc @alonyb
/assign
The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs.
This bot triages issues and PRs according to the following rules:
lifecycle/stale
is appliedlifecycle/stale
was applied, lifecycle/rotten
is appliedlifecycle/rotten
was applied, the issue is closedYou can:
/remove-lifecycle stale
/lifecycle rotten
/close
Please send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle stale
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.
This bot triages issues and PRs according to the following rules:
lifecycle/stale
is appliedlifecycle/stale
was applied, lifecycle/rotten
is appliedlifecycle/rotten
was applied, the issue is closedYou can:
/remove-lifecycle rotten
/close
Please send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle rotten
This also affects e.g. the kubelet/kubeadm/kubectl progress bars when using --driver=none, and is quite sad for users with lesser internet connections!
I noticed that
preloaded-images-k8s
andindex.docker.io/kicbase
progress bars step on each other when download is in progress and it is confusing for the user and might be interpreted as a glitch. When the download is finished, they are displayed in separate lines: