-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Set progress no update #2901
Open
leeagustin
wants to merge
6
commits into
plotly:dev
Choose a base branch
from
leeagustin:set-progress-no-update
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Set progress no update #2901
Changes from 2 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
3e42726
Allows for no_update in background callback set_progress
leeagustin 81f648a
Modifies integration test to set_progress to no_update
leeagustin 7437e2b
Modifies test to ensure using set_progress(no_update) does not reset …
leeagustin dbfcdb1
Removes unnecessary line used for debugging
leeagustin 21bc4b2
Adds lock to test_basic_long_callback014.py
leeagustin ccbeecf
Merge branch 'dev' into set-progress-no-update
T4rk1n File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be better to change this to lock to make sure it's not reset.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm assuming you meant to write look instead of lock. Would 7437e2b work?
The final results for this test (tests/integration/long_callback/test_basic_long_callback014.py) would be:
dev
In
dev
, the#progress-counter
is 3 because the value gets incremented every timeset_progress
is called, but it's correctly being left as 2 with this PR's changes.As for why
#progress-output
is set back to start indev
, I am not sure 🤔. However, it's correctly being left as stop in this PR.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think @T4rk1n was referring to
multiprocessing.Lock
, which you can find in some of the other Dash tests. This can remove the need for any explicitsleep
statements, which not only makes the tests faster but also more robust on CI where you never know what else is running on the same hardware and can lead to unexpected delays that will intermittently break tests based onsleep
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I was talking about a
multiprocessing.Lock
.Basically you would do in the callback
Then in the test you can also request the lock and do the assertions, so you can be sure the call to set_progress is done before the assertions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ohh I see, that makes sense. I added the lock in 21bc4b2 🔒