Skip to content

flaky: MongoDB Atlas integration tests fail with 'mongot is shutting down' #1095

Open

Description

@AmitoVrito

Problem

The integration CI job intermittently fails all of tests/retrieval/test_mongodb_atlas_integration.py with:

pymongo.errors.OperationFailure: PlanExecutor error during aggregation :: caused by :: mongot is shutting down

mongot is the Atlas Search sidecar process in the mongodb-atlas-local testcontainer. It appears the $search aggregation runs before mongot is fully ready (or while it is restarting), so the query hits a shutting-down search process rather than a genuine assertion failure.

Impact

Non-deterministic: a rerun of the same commit passes. It has blocked the integration job on at least two unrelated PRs (#1076 agent.serve, #1094 agent logic fixes), each requiring a manual gh run rerun --failed. It wastes ~8 min per rerun and erodes trust in a red integration check.

Affected tests (all 5 error together when it fires):

  • test_add_and_search_returns_true_nearest_neighbor
  • test_metadata_filter
  • test_persistence_across_reconnect
  • test_add_empty_is_noop
  • test_metadata_length_mismatch_raises

Suggested fix

Add an explicit readiness gate for mongot before the first $search query — poll the search index status until it reports READY (and the collection is queryable) in the testcontainer fixture, rather than relying on the container's own log-based wait. Consider pinning the mongodb-atlas-local image tag (avoid :latest) per the registry-pinning lesson from #1039/#1069, and a bounded retry around the first search op.

Not a product bug

MongoDBAtlasVectorStore itself is fine — this is a test-harness readiness/ordering issue.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    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