Skip to content

fix(tests): git-sync/test_s7_reserve_instance_id.py::TestMigrationPreflight fails in full suite, passes in isolation #763

Closed

Description

@AndriiPasternak31

Summary

4 tests in tests/git-sync/test_s7_reserve_instance_id.py::TestMigrationPreflight fail when run as part of the full integration suite. All 4 pass when run in isolation.

This test is the runtime guard for the S7 partial UNIQUE index (agent_git_config (github_repo, working_branch) WHERE source_mode=0) — preserved as a load-bearing invariant by #714. Silent failure at suite level means the production preflight migration check isn't being verified on every PR.

Context

Discovered via full test suite run on 2026-05-09:

FAILED git-sync/test_s7_reserve_instance_id.py::TestMigrationPreflight::test_detects_existing_duplicates
FAILED git-sync/test_s7_reserve_instance_id.py::TestMigrationPreflight::test_no_duplicates_returns_empty_list
FAILED git-sync/test_s7_reserve_instance_id.py::TestMigrationPreflight::test_migration_aborts_when_duplicates_exist
FAILED git-sync/test_s7_reserve_instance_id.py::TestMigrationPreflight::test_migration_installs_index_on_clean_db

Re-running in isolation:

pytest tests/git-sync/test_s7_reserve_instance_id.py
# all 4 pass

Reproduction

cd tests && source .venv/bin/activate
pytest --ignore=unit --ignore=process_engine --tb=short 2>&1 | grep -E "test_s7_reserve_instance_id"

Acceptance Criteria

  • All 4 TestMigrationPreflight tests pass when run (a) standalone, (b) in the full integration suite.
  • Root cause documented in PR description.
  • Add an order-independence pin in tests/conftest.py (or tests/git-sync/conftest.py) so the test's own DB seeding survives whichever earlier test pollutes state.

Investigation hints

Likely the same shape as #762 (sys.modules / db.connection.DB_PATH pollution from an earlier test). #714 already addressed a tests/unit/test_backlog.py:tmp_db leak that polluted db.connection.DB_PATH for unit tests; check whether a non-unit equivalent exists at integration tier.

Bisect:

pytest tests/<earlier_file>.py tests/git-sync/test_s7_reserve_instance_id.py

until the breakage reproduces.

Related

Activity

  1. added
    status-in-progress
    on May 11, 2026
  2. self-assigned this
    on May 11, 2026
  3. added
    status-in-dev
    and removed
    status-in-progress
    on May 28, 2026
  4. vybe commented on Jun 1, 2026

    @vybe
    Contributor

    Shipped in v0.6.0 (released via #998).

  5. added
    theme-devex
    and removed
    status-in-dev
    on Jun 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

priority-p2theme-devextype-bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions