Describe the bug
When Progress.updateFrequency and tracker completion time are both small and similar(especially equal), the overall tracker may disappears.
The reason for this (maybe): the overall tracker is determined to be done before the tracker is appended, but the tracker is successfully appended before the next render. Progress continues to run, but the overall tracker will never appear again.
In short: overall tracker is done, but new tracker is being added.
To Reproduce
package main
import (
"fmt"
"github.com/jedib0t/go-pretty/v6/progress"
"strconv"
"time"
)
func main() {
pw := progress.NewWriter()
pw.SetTrackerPosition(progress.PositionRight)
pw.SetUpdateFrequency(time.Millisecond * 100)
pw.Style().Colors = progress.StyleColorsExample
pw.Style().Visibility.TrackerOverall = true
go pw.Render()
sem := make(chan struct{}, 3)
for i := 0; i < 1000; i++ {
sem <- struct{}{}
go func(n int) {
tracker := progress.Tracker{Message: strconv.Itoa(n)}
pw.AppendTracker(&tracker)
time.Sleep(100 * time.Millisecond)
tracker.MarkAsDone()
<-sem
}(i)
}
}
Expected behavior
Overall tracker will still run in the case.
Software (please complete the following information):
Describe the bug When
Progress.updateFrequency
andtracker completion time
are both small and similar(especially equal), the overall tracker may disappears.The reason for this (maybe): the overall tracker is determined to be done before the tracker is appended, but the tracker is successfully appended before the next render. Progress continues to run, but the overall tracker will never appear again.
In short: overall tracker is done, but new tracker is being added.
To Reproduce
Expected behavior Overall tracker will still run in the case.
Software (please complete the following information):