Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[progress] corner case: overall tracker disappears #245

iyear opened this issue Nov 27, 2022 · 1 comment · Fixed by #246

[progress] corner case: overall tracker disappears #245

iyear opened this issue Nov 27, 2022 · 1 comment · Fixed by #246


Copy link

iyear commented Nov 27, 2022

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 (

func main() {
	pw := progress.NewWriter()
	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)}
			time.Sleep(100 * time.Millisecond)


Expected behavior
Overall tracker will still run in the case.

Software (please complete the following information):

  • OS: windows
  • GoLang Version: 1.19
Copy link

jedib0t commented Nov 28, 2022

Cut a tag for you with the fix:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet

Successfully merging a pull request may close this issue.

2 participants