Skip to content

test(conftest): force ENGRAPHIS_EXTRACTOR=none for the offline gate - #165

Closed
Coding-Dev-Tools wants to merge 1 commit into
mainfrom
fix/conftest-offline-extractor-gate
Closed

test(conftest): force ENGRAPHIS_EXTRACTOR=none for the offline gate#165
Coding-Dev-Tools wants to merge 1 commit into
mainfrom
fix/conftest-offline-extractor-gate

Conversation

@Coding-Dev-Tools

Copy link
Copy Markdown
Owner

Summary

Forces ENGRAPHIS_EXTRACTOR=none in the root conftest.py instead of using setdefault, closing a leak where an owner-machine shell export (ENGRAPHIS_EXTRACTOR=llm_structured) put a live LLM extractor into the offline unit gate.

Root cause

  • The offline gate contract (AGENTS.md §1) requires python -m pytest tests/ -q to pass network-free.
  • conftest's previous guard used os.environ.setdefault("ENGRAPHIS_EXTRACTOR", "none"), which defers to any pre-existing shell variable.
  • On machines exporting the variable, every ingest-path test constructed a real extractor; under tests/conftest.py's DNS stub the extraction call hangs rather than failing fast.
  • Observed effect: deterministic timeout failure of test_session_close_linearizes_before_delayed_memory_write[ingest] — the writer thread never reached the embed hook within the test window.

Fix

  • Direct assignment (os.environ["ENGRAPHIS_EXTRACTOR"] = "none"), matching the existing ENGRAPHIS_UPDATE_CHECK treatment in the same file.
  • Tests that deliberately exercise extraction still opt in explicitly via monkeypatch.setenv; no test relies on shell-passthrough (verified by grep across tests/).

Verification

  • Previously failing test + full file: pass.
  • Full suite pytest tests/ -q distributed: green (exit 0).
  • ruff clean; pyright 0 errors/0 warnings on core+backends; commercial manifest OK; asset-drift check OK.

setdefault kept a real shell export working, so an owner machine exporting
ENGRAPHIS_EXTRACTOR=llm_structured leaked a live LLM extractor into every
ingest-path test. Under tests/conftest.py's DNS stub the extraction call
hangs instead of failing fast, deterministically timing out
test_session_close_linearizes_before_delayed_memory_write[ingest].

Force the variable to "none" like ENGRAPHIS_UPDATE_CHECK; tests that
exercise extraction already opt back in explicitly via monkeypatch.setenv.
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@Coding-Dev-Tools

Copy link
Copy Markdown
Owner Author

Closing as superseded: the identical commit (7503e2e) was merged via #166 (merge 1ce18cf). No content lost.

@Coding-Dev-Tools
Coding-Dev-Tools deleted the fix/conftest-offline-extractor-gate branch August 25, 2026 16:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant