This repository was archived by the owner on Apr 26, 2024. It is now read-only.
Closed
Conversation
48 tasks
f016f9b to
815a5cb
Compare
erikjohnston
reviewed
Sep 1, 2020
| self._check_test_key("one") | ||
| d = Clock(reactor).sleep(0) | ||
| # Theoretically the ensureDeferred shouldn't be necessary here, but | ||
| # it forces trial to fire the awaitable. |
Member
There was a problem hiding this comment.
Sorry, can you expand on this a bit? I don't really understand what you mean by "fire"?
Member
Author
There was a problem hiding this comment.
I think in order to get Twisted to actually run the sleep call it needs to be wrapped in ensureDeferred?
That doesn't really seem right though since the run_in_background call in _test_run_in_background should handle that.
Without this change it was hanging on the await d call below.
Member
Author
|
I'm going to close this for now, I think it is causing some odd interaction between the reactor and the asyncio code, but I haven't seen this causing any issues while attempting to profile so hopefully it is fine. |
This file contains hidden or 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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
This converts
Clock.sleepto async.I removed some sleep calls in the tests without ill effect, but I'm not 100% sure that removing them is OK. (Although if the tests still pass it kind of implies that they were either not necessary or that the tests isn't testing what we hope it is.)