Skip to content

fix(#935): unit conftest stub cleanup for cross-file sys.modules pollution - #938

Merged
vybe merged 1 commit into
devfrom
fix/935-conftest-stub-pollution
May 25, 2026
Merged

vybe merged 1 commit into
devfrom
fix/935-conftest-stub-pollution

Conversation

@obasilakis

Copy link
Copy Markdown
Contributor

Summary

Closes #935.

Adds the four module names called out in the issue to the existing
baseline-restore / pop-prefix machinery so stubs installed by one unit
test file stop leaking into the next:

  • tests/conftest.py _SYS_MODULES_INVARIANT_KEYS: + services.docker_service
  • tests/unit/conftest.py _POP_PREFIXES: + services.task_execution_service, services.cleanup_service, dependencies

Two-line surface, no production code touched.

Repro / verification

Deterministic order (per the issue's repro command):

pytest tests/unit/test_auto_retry_reader_race.py \
       tests/unit/test_file_upload.py \
       tests/unit/test_session_persistence_flag.py \
       tests/unit/test_fleet_status_resilience.py \
       tests/unit/test_startup_recovery_race.py \
       tests/test_github_pat_propagation_unit.py -p no:randomly

Before: 22 failed, 58 passed — a stub for services.docker_service
(missing get_agent_container) leaked into adapters.message_router and
services.cleanup_service imports collected by later test files.

After: 80 passed. Also clean with default pytest-randomly
ordering.

Test plan

  • Reproduce the failure on origin/dev
  • Apply the conftest changes
  • Confirm the same command now passes deterministically
  • Confirm the same command passes under default pytest-randomly ordering

…ution

Adds the four module names called out in #935 to the existing baseline-
restore / pop-prefix machinery so stubs installed by one unit test file
stop leaking into the next.

- tests/conftest.py _SYS_MODULES_INVARIANT_KEYS: + services.docker_service
- tests/unit/conftest.py _POP_PREFIXES: + services.task_execution_service,
  services.cleanup_service, dependencies

Repro on origin/dev (deterministic order):

  pytest tests/unit/test_auto_retry_reader_race.py \
         tests/unit/test_file_upload.py \
         tests/unit/test_session_persistence_flag.py \
         tests/unit/test_fleet_status_resilience.py \
         tests/unit/test_startup_recovery_race.py \
         tests/test_github_pat_propagation_unit.py -p no:randomly

Before: 22 failed, 58 passed — stub for services.docker_service
(missing get_agent_container) leaked into adapters.message_router and
services.cleanup_service imports collected by later files.

After: 80 passed (also clean with default pytest-randomly ordering).

@vybe vybe left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved per /validate-pr — two-line conftest fix, only test infrastructure, clean security scan, repro and before/after documented in PR body.

@vybe
vybe merged commit 933fde2 into dev May 25, 2026
12 checks passed
vybe added a commit that referenced this pull request Nov 2, 2026
…rprise#936, #938, #940)

- Judge tab: a refused save clears the earlier "Saved." marker, so a
  dismissed error never reads as saved (the one CRITICAL).
- A person the agent is merely shared with is not an operator: the judge's
  words and a Tier-1 score are withheld from them as the comment already is,
  with the token findings in place; the ent#781 contract test says so.
- A caller that ended `skipped` has ended: one CALLER_ENDED_STATUSES for the
  pair evaluator and its re-pick query, so a callee's provisional row no
  longer waits forever.
- The refusal read is one 200-row page; a full page is unreadable, never a
  pass on evidence that was not read.
- 0115 / tier1_one_per_run: NULL updated_at ranks the same on both backends.
- Operations: Health and Evaluations render slots read the one TAB_GATES
  map; ExecutionChecks encodes its path segments; the rating control hides
  only on 403/404 and reports any other failure; the tracker-list error
  dismisses instead of re-fetching.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
vybe added a commit that referenced this pull request Nov 2, 2026
…rprise#936, #938, #940)

- Judge tab: a refused save clears the earlier "Saved." marker, so a
  dismissed error never reads as saved (the one CRITICAL).
- A person the agent is merely shared with is not an operator: the judge's
  words and a Tier-1 score are withheld from them as the comment already is,
  with the token findings in place; the ent#781 contract test says so.
- A caller that ended `skipped` has ended: one CALLER_ENDED_STATUSES for the
  pair evaluator and its re-pick query, so a callee's provisional row no
  longer waits forever.
- The refusal read is one 200-row page; a full page is unreadable, never a
  pass on evidence that was not read.
- 0115 / tier1_one_per_run: NULL updated_at ranks the same on both backends.
- Operations: Health and Evaluations render slots read the one TAB_GATES
  map; ExecutionChecks encodes its path segments; the rating control hides
  only on 403/404 and reports any other failure; the tracker-list error
  dismisses instead of re-fetching.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
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.

2 participants