Repository navigation
Description
Filed at the owner's request from the 2026-10-09 review of GitHub Actions warnings and notices.
Problem
Checked at release/v0.2.32 (27cf6bd). The Tests & Coverage job of CI run https://github.com/dan-petty/devops-cli/actions/runs/37939949186/job/113851481357 ran on release/v0.2.31 at a6ac3f0, the same tree, and ends with 10268 passed, 24 skipped, 8 xfailed, 42 warnings. 33 of the 42 have a fix on our side.
20 × ResourceWarning: unclosed database in <sqlite3.Connection ...>: tests leave sqlite connections open
- The summary pins each warning on whichever test was running when the garbage collector finalized the connection: 8 on
test_ai_spend_ledger.py::test_devops_ai_cost_cli_by_stage, 5 ontest_ai_spend_pricing.py::test_pricing_registry_offline_defaults, and the rest across five more tests. It also names sites such asgenai_prices/types.py:913andtyping.py:433. None of these opened the connections. - A tracemalloc run (
PYTHONTRACEMALLOC=10,-n 0,-W always::ResourceWarning) traced the leaks towith sqlite3.connect(path) as conn:blocks in tests. The sqlite3 connection's context manager commits or rolls back, but it does not close the connection [measured]. The 13 sites:tests/test_ai_spend_ledger.py:19,:177,:208,:509,:514,:547,:575tests/test_ai_served_by.py:102,:111tests/test_ai_spend_dispatch.py:218,:279tests/test_review_profile.py:614tests/test_telemetry_instruments.py:415
src/already closes its connections. The ledger usescontextlib.closing(...)(src/devops_cli/ai/spend/ledger.py:252,:289,:377,:552).- This command fails 6 tests in about 7 s [measured]:
uv run pytest -p no:cacheprovider -q -n 0 --no-cov -W error::ResourceWarning -W error::pytest.PytestUnraisableExceptionWarning tests/test_ai_spend_ledger.py tests/test_ai_spend_dispatch.py tests/test_review_profile.py tests/test_telemetry_instruments.py
9 × PydanticDeprecatedSince20: pydantic.config.Extra is deprecated (from inspect.py:506): library ingest reads deprecated attributes
- The warnings come 3 each from
tests/test_library_ingest.py::test_introspect_installed_package,::test_cli_ai_ingest_libraryand::test_cli_ai_ingest_library_json_format. All three introspect pydantic itself. _extract_methods_and_props(src/devops_cli/ai/library/introspector.py:108) callsinspect.getmembers(cls)on every public class. On pydantic 2.13.5 that readsExtra.allow,.ignoreand.forbid, and the class's metaclass warns on each read (pydantic/deprecated/config.py:54-59). Stack:introspector.py:260→:193→:164→:136→:108[measured]. devops-cli itself never usesExtra.uv run pytest -p no:cacheprovider -q -n 0 --no-cov -W error::DeprecationWarning tests/test_library_ingest.pyfails those 3 tests [measured].inspect.getmembers_staticavoids the reads, but it is not a drop-in replacement. It changes the extracted catalogue for 49 of pydantic's 264 classes; for example, it addsfromkeystoConfigDictandmodel_fieldstoBaseModel[measured].
4 × starlette/testclient.py:53: DeprecationWarning: The anyio.abc.BlockingPortal alias is deprecated: the lock holds an old starlette
- The warning appears once per xdist worker, at collection.
uv.lockhas starlette 1.6.0 with anyio 4.15.1. Tests import starlette throughfastapi.testclient(tests/test_server.py:9,tests/test_server_stream.py:7,tests/test_server_service.py:20,tests/test_ai_spend_prometheus.py:8).- starlette 1.7.0 (2026-09-23), the newest release, uses
anyio.from_thread.BlockingPortal(starlette/testclient.py:53at tag 1.7.0). It requires AnyIO 4, which the lock already has. - Nothing holds starlette below 1.7.0: fastapi 0.142.2 needs
>=0.46.0, mcp 2.3.0>=0.48.0and sse-starlette>=0.49.1. - The lock does not move on its own, because
.github/renovate.jsonturns the pep621 manager off.
The other 9 warnings are tracked elsewhere:
- 5 × logfire "API is unreachable": fix(ci): review workflow tests start the logfire SDK's credential check, which the network guard blocks #965.
- 2 ×
PydanticJsonSchemaWarningfrom the MCP tools'ctxparameter: filed separately as a fix(ai) item. - 2 × google-genai
_UnionGenericAlias: upstream has not released a fix yet (DeprecationWarning: '_UnionGenericAlias' is deprecated and slated for removal in Python 3.17 googleapis/python-genai#1640).
Proposed remedy
- Close every test connection with
with contextlib.closing(sqlite3.connect(path)) as conn:, asledger.pydoes, and add, connwhere the block writes. Where a helper opens the connection (_ledger_rows,_columns,_finish_reasons), fix it in the helper. - In
PackageIntrospector.introspect_package, read the members insidewarnings.catch_warnings()withwarnings.simplefilter("ignore", DeprecationWarning), plus a one-line comment. Reading a package's API to catalogue it does not use that API, and the deprecations belong to the package being read. The catalogue does not change. - Run
uv lock --upgrade-package starlette(1.6.0 → 1.7.0).
Acceptance criteria
- The ResourceWarning command above passes. The same flags on
tests/test_ai_served_by.pyreport nounclosed database; its unclosed tiktoken socket belongs to fix(ai): the context-budget tokenizer downloads its encoding on first use and silently falls back to a heuristic #1421. -
uv run pytest -p no:cacheprovider -q -n 0 --no-cov -W error::DeprecationWarning tests/test_library_ingest.pypasses. - Apart from its timestamp, the catalogue that
devops ai ingest library pydantic --max-depth 1writes is the same as before. -
uv.lockhas starlette 1.7.0 or later, and the FastAPITestClientserver tests pass. - The CI pytest summary lists no
unclosed database,pydantic.config.Extraoranyio.abc.BlockingPortalwarning. -
uv run devops cipasses.
Related: #1421 (tiktoken download in tests), #1329 (owns test_library_ingest.py for its edge-fake migration), #1331.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
dan-petty-bot commentedon Oct 9, 2026
Intake placed this item to the backlog: at intake only a critical fix goes into a release; a release start pulls Ready items in, P0 features first.
All 10268 tests pass; these are warnings that will become errors only after future dependency upgrades, so they are hygiene rather than a blocker.Clean CI output reduces noise for real failures and prevents breakage when the deprecated APIs are removed in upcoming releases.Thirteen test sites need explicit close calls, the introspector needs a safe member-reading path, and the starlette pin must be bumped and re-locked.dan-petty commentedon Oct 20, 2026
Three more warnings in the CI test summary have no owner. Folding them in here so the test run can end warning-free.
Seen in job 118675899791 of run 39436644820 (11080 passed, 40 warnings):
UserWarning: Api key is used with an insecure connectionfrom qdrant-client, throughtests/conftest.py, intests/test_ai_subcommands_rag.py::test_try_retrieve_rag_context_success._UnionGenericAliasDeprecationWarningintests/test_pydantic_ai_profiles_and_providers.py::TestPydanticAIProviders::test_native_provider_classes_and_subclasses. This item left it to upstream (DeprecationWarning: '_UnionGenericAlias' is deprecated and slated for removal in Python 3.17 googleapis/python-genai#1640). Upstream still has it open, so it needs a recorded reason or a fix here.LogfireNotConfiguredWarningfromsrc/devops_cli/telemetry/logfire.py, intests/test_telemetry_logfire.py::test_logfire_bridge_configuration_without_token_fallback.#1498 still owns the
PydanticJsonSchemaWarninglines.fix(tests): close sqlite test connections, silence inspected library …
dan-petty commentedon Oct 21, 2026
What changed
#1769, merged into
release/v0.2.38as 2766e0f.10 file(s) changed.
How it was verified
Check runs at 1d0e577:
Acceptance Criteria of
docs/agent/tasks/task-1497-test-run-warnings.md:No Acceptance Criteria section.
feat(release): v0.2.38 (#1799)
feat(release): v0.2.38 (#1798)