Repository navigation
Closed
Labels
Milestone
Description
Friction
During devops ci runs under pytest-xdist and pytest-randomly, tests that inspect caplog.records while loading settings (such as tests/test_roadmap_refine.py::test_a_research_plan_that_never_fits_its_schema_refines_without_search_results and tests/test_review_embeddings_unserved.py) fail whenever tests/test_config_cmd.py::test_strict_keyring_access_raises_instead_of_reading_as_missing runs earlier on the same xdist worker.
Evidence
Deterministic reproduction without pytest-randomly:
$ uv run pytest -p no:randomly -o addopts="" \
tests/test_config_cmd.py::test_strict_keyring_access_raises_instead_of_reading_as_missing \
tests/test_roadmap_refine.py::test_a_research_plan_that_never_fits_its_schema_refines_without_search_results
FAILED tests/test_roadmap_refine.py::test_a_research_plan_that_never_fits_its_schema_refines_without_search_results
Captured log call:
WARNING devops_cli.config.settings:settings.py:756 Cannot read a secret: the OS keyring is locked; run `devops devcontainer unlock-keyring`
Root cause:
test_strict_keyring_access_raises_instead_of_reading_as_missingintests/test_config_cmd.py(andFakeKeyringintests/cluster_secret_fakes.py) subclasseskeyring.backend.KeyringBackendwithpriority = 1anderror: Exception = KeyringLocked("locked").KeyringBackendMetaregisters everyKeyringBackendsubclass in the process-globalKeyringBackend._classesset when the class is defined.- In subsequent tests on the same worker,
keyring.get_keyring()returnsChainerBackend, whose.backendsproperty queriesKeyringBackend.get_viable_backends(), instantiatingRaising()withpriority = 1and defaultKeyringLocked("locked"). Every_keyring_get()call then raisesKeyringLockedand logsCannot read a secret: the OS keyring is locked; run devops devcontainer unlock-keyring.
Proposed Remedy
- Avoid subclassing
keyring.backend.KeyringBackendin test doubles (or remove test subclasses fromKeyringBackend._classeson teardown) and isolatekeyring.get_keyringintests/conftest.pywith an autouse fixture so no test reads or mutates process-global keyring backend state across tests. - Add a regression test verifying that running
test_strict_keyring_access_raises_instead_of_reading_as_missingbefore a settings load does not leaveRaisinginKeyringBackend._classesor emit locked-keyring warnings in subsequent tests.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
dan-petty commentedon Oct 16, 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.
The candidate focuses on fixing a test-related issue with keyring backend isolation.The issue affects test reliability and reproducibility under specific conditions but does not block core functionality.Fixing this improves test stability and reduces flaky test failures, which benefits the team's development workflow.The fix involves isolating keyring backend state in tests with a simple autouse fixture and adding one regression test.fix(tests): isolate KeyringBackend._classes registration across xdist…
dan-petty commentedon Oct 17, 2026
What changed
#1607, merged into
release/v0.2.36as 4cd237f.4 file(s) changed.
How it was verified
Check runs at dee6c29:
No task file.
feat(release): v0.2.36 (#1615)