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

Job strangeness when progress: and title: are both updated #2815

Open
fuhrmanator opened this Issue Mar 14, 2019 · 0 comments

Comments

Projects
None yet
1 participant
@fuhrmanator
Copy link

fuhrmanator commented Mar 14, 2019

I'm using Job to show progress bars on my code and I sometimes find that the message is "off by one" from the progress. I created a MWE below that reproduces the bug in Pharo 7 on Windows and Unix (WSL):

| myColl |
myColl := 1 to: 3.
[ :job | 
myColl do: [ :e | 
    job
        progress: e/(myColl size); 
	title: 'waiting ' , e asString.
    (Delay forSeconds: 3) wait ] ] asJob run

What I see is

  • Progress bar appears with 1/3 of a bar and no message.
  • 3 seconds pass
  • Progress bar appears with 1/3 of a bar and message 'Waiting 1/3'
  • 3 seconds pass
  • Progress bar appears with 2/3 of a bar and message 'Waiting 2/3'
  • 3 seconds pass
  • Progress bar disappears

So, from this I see a bug that the first message never appears and the last message and progress (3/3) never appears.

However:

  • If I take out the title: call (only leaving the progress: update), it works as expected.
  • If I take out the progress: call (only leaving the title: update), it works as expected.

The reason I'm interested in using both title: and progress: is that I have jobs with several long steps (cloning a git, creating metamodels, etc.) and I want to show progress along with a feedback for which step is running. This seems like a bug, but maybe I'm not using Job appropriately?

@fuhrmanator fuhrmanator changed the title Job strangeness when `progress:` and `title:` are both updated Job strangeness when progress: and title: are both updated Mar 14, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.