-
Notifications
You must be signed in to change notification settings - Fork 685
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
Finish out effort of adding and enabling blockbuster in tests #5735
Changes from 3 commits
548b3ef
57164d4
42eb44f
3d222a2
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 |
---|---|---|
|
@@ -2,10 +2,13 @@ | |
|
||
from unittest.mock import patch | ||
|
||
import pytest | ||
|
||
from supervisor.bootstrap import initialize_coresys | ||
|
||
|
||
async def test_sentry_disabled_by_default(supervisor_name): | ||
@pytest.mark.usefixtures("supervisor_name", "docker") | ||
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 is unrelated to the PR, this test is just broken in devcontainer right now. Mocking all docker connections with the However on the bright side, it did find more blocking I/O. Turns out initializing the docker |
||
async def test_sentry_disabled_by_default(): | ||
"""Test diagnostics off by default.""" | ||
with ( | ||
patch("supervisor.bootstrap.initialize_system"), | ||
|
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.
💡 Verification agent
❓ Verification inconclusive
Wrap Docker client creation in a try-except block.
Asynchronously creating the
DockerClient
insiderun_in_executor
is a good step to avoid blocking the event loop. However, you may want to wrap it in a try-except block forDockerException
orrequests.RequestException
to raise a more descriptive error (e.g.,DockerAPIError
) if Docker is unavailable or the socket is misconfigured. This aligns with your handling of Docker-related exceptions elsewhere in the file.Wrap Docker client creation with exception handling.
In
supervisor/docker/manager.py
(lines 116–127), please wrap the Docker client instantiation in a try-except block. This will catch potentialDockerException
orrequests.RequestException
errors—raising a more descriptive error (e.g., a customDockerAPIError
) if Docker is unavailable or the socket is misconfigured. This change will also bring the exception handling in line with similar parts of the file.asyncio.get_running_loop().run_in_executor(...)
call with a try-except block.DockerException
andrequests.RequestException
and re-raise them with a more descriptive error.