Skip to content

Local test setup fails with NoSuchTableError during sync_search_vector_triggers #431

@kbighorse

Description

@kbighorse

Summary

Running pytest locally fails during test setup with sqlalchemy.exc.NoSuchTableError: asset when sync_search_vector_triggers runs after schema recreation.

Environment

  • Local PostgreSQL with PostGIS
  • Tests work in CI (PostGIS Docker container)

Error

tests/conftest.py:47: in _setup_test_db
    _sync_search_vectors()
...
sqlalchemy.exc.NoSuchTableError: asset

Steps to Reproduce

  1. Have local PostgreSQL with PostGIS
  2. Run uv run pytest tests/test_thing.py -v
  3. Test setup fails at sync_search_vector_triggers

Analysis

The conftest.py test setup:

  1. recreate_public_schema() - drops and recreates schema
  2. alembic upgrade head - runs migrations (completes successfully per logs)
  3. sync_search_vector_triggers() - fails because it can't find asset table

The migrations report completion but the subsequent sync function can't see the tables. This may be:

  • Connection pooling/caching issue
  • Transaction isolation issue
  • Engine not refreshed after schema recreation

Workaround

CI tests pass, so pushing and letting CI validate is the current workaround.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions