-
Notifications
You must be signed in to change notification settings - Fork 258
Fix test_shutdown_worker leaving stale callback that breaks later tests #7279
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -16,17 +16,12 @@ | |
|
|
||
|
|
||
| @pytest.mark.requires_rmq | ||
| @pytest.mark.asyncio | ||
| async def test_shutdown_worker(manager): | ||
| def test_shutdown_worker(manager): | ||
| """Test the ``shutdown_worker`` method.""" | ||
| runner = manager.get_runner() | ||
| await shutdown_worker(runner) | ||
|
|
||
| try: | ||
| assert runner.is_closed() | ||
| finally: | ||
| # Reset the runner of the manager, because once closed it cannot be reused by other tests. | ||
| manager._runner = None | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why this is no longer needed?
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| runner.loop.create_task(shutdown_worker(runner)) | ||
| runner.loop.run_forever() | ||
| assert runner.is_closed() | ||
|
|
||
|
|
||
| @pytest.mark.usefixtures('aiida_profile_clean', 'started_daemon_client') | ||
|
|
||
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 guess deleting this fixture is only safe if we modify the
managerfixture in the previous PR?Uh oh!
There was an error while loading. Please reload this page.
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 exactly by commit 46b6f66 we fix the bad fixture usage requirement of reseting the runner inside the test when using the manager fixture. There was however the subsequent issue with
test_shutdown_workerthat did not allow use to remove it in the PR #7268. Because its quite complicated requiring to understand implementation details from the python event loop, a different PR for discussion made also sense.