-
-
Notifications
You must be signed in to change notification settings - Fork 748
Ensure test_scheduler does not leak open sockets #4921
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 | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -313,10 +313,15 @@ def func(scheduler): | |||||||||||||||
| await comm.close() | ||||||||||||||||
|
|
||||||||||||||||
|
|
||||||||||||||||
| def test_scheduler_init_pulls_blocked_handlers_from_config(): | ||||||||||||||||
| @pytest.mark.asyncio | ||||||||||||||||
| async def test_scheduler_init_pulls_blocked_handlers_from_config(): | ||||||||||||||||
| # This test is async to allow us to properly close the scheduler since the | ||||||||||||||||
| # init is already opening sockets for the HTTP server See also | ||||||||||||||||
| # https://github.com/dask/distributed/issues/4806 | ||||||||||||||||
| with dask.config.set({"distributed.scheduler.blocked-handlers": ["test-handler"]}): | ||||||||||||||||
| s = Scheduler() | ||||||||||||||||
| assert s.blocked_handlers == ["test-handler"] | ||||||||||||||||
| await s.close() | ||||||||||||||||
|
Comment on lines
321
to
+324
Member
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.
Suggested change
Member
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. Based on the comment earlier in this test, it looks like we want to check that
Member
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. OK |
||||||||||||||||
|
|
||||||||||||||||
|
|
||||||||||||||||
| @gen_cluster() | ||||||||||||||||
|
|
@@ -673,6 +678,7 @@ async def test_update_graph_culls(s, a, b): | |||||||||||||||
| def test_io_loop(loop): | ||||||||||||||||
| s = Scheduler(loop=loop, validate=True) | ||||||||||||||||
| assert s.io_loop is loop | ||||||||||||||||
| loop.run_sync(s.close) | ||||||||||||||||
|
|
||||||||||||||||
|
|
||||||||||||||||
| @gen_cluster(client=True) | ||||||||||||||||
|
|
@@ -1396,7 +1402,11 @@ async def test_get_task_status(c, s, a, b): | |||||||||||||||
| assert result == {future.key: "memory"} | ||||||||||||||||
|
|
||||||||||||||||
|
|
||||||||||||||||
| def test_deque_handler(): | ||||||||||||||||
| @pytest.mark.asyncio | ||||||||||||||||
| async def test_deque_handler(): | ||||||||||||||||
| # This test is async to allow us to properly close the scheduler since the | ||||||||||||||||
| # init is already opening sockets for the HTTP server See also | ||||||||||||||||
| # https://github.com/dask/distributed/issues/4806 | ||||||||||||||||
| from distributed.scheduler import logger | ||||||||||||||||
|
|
||||||||||||||||
| s = Scheduler() | ||||||||||||||||
|
|
@@ -1406,6 +1416,7 @@ def test_deque_handler(): | |||||||||||||||
| msg = deque_handler.deque[-1] | ||||||||||||||||
| assert "distributed.scheduler" in deque_handler.format(msg) | ||||||||||||||||
| assert any(msg.msg == "foo123" for msg in deque_handler.deque) | ||||||||||||||||
| await s.close() | ||||||||||||||||
|
Member
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. We can probably use |
||||||||||||||||
|
|
||||||||||||||||
|
|
||||||||||||||||
| @gen_cluster(client=True) | ||||||||||||||||
|
|
||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -45,6 +45,9 @@ parentdir_prefix = distributed- | |
| addopts = -v -rsxfE --durations=20 | ||
| filterwarnings = | ||
| error:Since distributed.*:PendingDeprecationWarning | ||
|
|
||
| # See https://github.com/dask/distributed/issues/4806 | ||
| error:Port:UserWarning:distributed.node | ||
|
Member
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. This would raise and fail the tests whenever the warning is raised during CI. AFAIU, we should not hit this condition accidentally if we properly close all servers properly. |
||
| minversion = 4 | ||
| markers = | ||
| slow: marks tests as slow (deselect with '-m "not slow"') | ||
|
|
||
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 is new and was also a cause for this warning message. If an exception during worker startup would fail, the scheduler was not cleaned up properly. This should've been implemented regardless of the warning, I believe
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.
+1