-
Notifications
You must be signed in to change notification settings - Fork 636
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
[WIP] async code and dispose in tests #14649
Closed
Closed
Changes from 6 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
073170e
update
pinzart 151bbe8
Update DynamoTestUIBase.cs
pinzart a05f9a1
update
pinzart c78c1a7
update
pinzart 28e0163
update
pinzart eb60fc1
Update CLIWrapperTests.cs
pinzart fe9a11e
update
pinzart 03e8ade
Update DynamoTestUIBase.cs
pinzart c82d1fe
Update PackageManagerUITests.cs
pinzart 83143b5
update
pinzart 613c704
Update LibraryViewController.cs
pinzart 85e6d94
Update DocumentationBrowserView.xaml.cs
pinzart 08be589
Update NotificationCenterController.cs
pinzart f909d62
update
pinzart 009732f
update
pinzart 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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
This caused a deadlock when running tests on a single thread (could happen in live scenario too)
The .Result blocks the current thread until the task is completed.
And inside the GetData() the await Task will never finish because the main thread cannot poll for the status
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.
would an alternative be to always access this data from another thread, for example - like we do with the feature flags manager startup - run the GetData call inside on a task in the thread pool?
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.
It might work. But having a separate thread started everywhere GetData.Result is called might be harder to maintain
I find it easier to reason about when the entire concurrency logic is boxed up inside the GetData method so callers do not need to worry about how to call it
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 actually used the approach you suggested for another case (in a test file)
https://github.com/DynamoDS/Dynamo/pull/14649/files#diff-be236d5cf3315a8f37d3d67a4adb628825430289b534dbd620952c47f2d286b0R1136
For production code (like GetData) I still think it would make it tricky to figure out how to use it safely.