Repository navigation
Real testcontainers tests for MongoDB Atlas Vector Search + async-first guard — #829 - #835
Merged
Merged
Conversation
#829) Replace the MagicMock MongoDBAtlasVectorStore test with real coverage against the mongodb/mongodb-atlas-local image (actual $vectorSearch). Handles the Atlas specifics the mock couldn't: out-of-band vector search index creation, waiting for the search service (mongot) to come up and the index to become queryable, and polling for eventual consistency before asserting. Confirms the store is correct end-to-end (true kNN ranking, metadata filter, reconnect persistence) — no code change needed. Also asserts the async-first contract (add/search are coroutines). Part of #829.
…ion tests SynapseKit is async-first; lock it in with an iscoroutinefunction assertion on add/search for the pgvector, redis, and elasticsearch stores so a future change can't silently desugar the public IO surface to sync. Part of #829.
…tests
The atlas-local single-node replica set briefly steps down / restarts when its
search service (mongot) first initializes, so the first operation after index
creation could hit NotPrimaryError ("interrupted at shutdown") in CI. Retry
inserts and searches on transient PyMongoError — a startup artifact of the local
image, not a store issue (real Atlas doesn't restart mid-use).
Part of #829.
…stability CI's atlas-local is more unstable than local during mongot init: any op can hit NotPrimary / "Error connecting to Search Index Management service" (125) while the single-node replica set steps down. Make every server op transient-tolerant via a shared retry helper, and warm mongot up once in the fixture so the one-time step-down is absorbed before any test runs. Part of #829.
Closed
18 of 19 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Next in epic #829: MongoDB Atlas Vector Search, plus an async-first contract guard across the vector stores.
MongoDB
Converted to real testcontainers tests against
mongodb/mongodb-atlas-local(actual$vectorSearch— the plainmongoimage can't do vector search). The test harness handles what a mock can't: out-of-band vector-search-index creation, waiting for the search service (mongot) to come up + the index to become queryable, and polling for Atlas eventual consistency before asserting.Result:
MongoDBAtlasVectorStoreis correct end-to-end — real kNN nearest-neighbour ranking, native$vectorSearchmetadata filter, reconnect persistence — no code change needed (deep testing confirms correctness, not just finds bugs). Removes the MagicMock test.Async-first guard
Per the async-first invariant, adds an
iscoroutinefunctionassertion onadd/searchfor the pgvector, redis, es, and mongo stores so a future change can't silently desugar the public IO surface to sync.Verification (real data)
5/5 Mongo tests pass against real Atlas Local vector search (real inserts + real
$vectorSearch, ~22s). Wired into the CIintegrationjob.Commits
test(retrieval): real MongoDB Atlas Vector Search testcontainers tests (#829)test(retrieval): assert async-first contract in vector-store integration testsci(test): add pymongo to the integration group and mongo test to CI (#829)Part of #829.