rsalmei / alive-progress

A new kind of Progress Bar, with real-time throughput, ETA, and very cool animations!
MIT License
5.53k stars 206 forks source link

Bar which completes instantly sometimes has visual artefacts #18

Closed daviewales closed 4 years ago

daviewales commented 4 years ago

This:

with alive_bar(1) as bar:
     for i in range(1):
         # time.sleep(1)
         bar()

sometimes produces:

|████████████████████████████████████████| 1/1 [100%] in 0.0s (67650.06/s)

In [73]: |████████████████████████████████████████| ▁▃▅ 1/1 [100%] in 0.0s (163.32/s)

Adding the sleep function appears to prevent the artefact!

with alive_bar(1) as bar:
     for i in range(1):
         time.sleep(1)
         bar()
|████████████████████████████████████████| 1/1 [100%] in 1.0s (1.00/s)

In [74]:

Also, simply pressing 'Enter' makes the artefact disappear.

rogerio-geru commented 4 years ago

Hey @daviewales !

Thanks, it was hard to reproduce, I had to run several times, but I did see it! Must be a subtle race condition, gonna try to sort this out.

rsalmei commented 4 years ago

Hello @daviewales!

I've finally found the time to fix this, releasing a 1.3.1 build with that! Thanks for your report again.