cosmosdb: CosmosDBNoSQLEndpointContainer doesn't work with vnext-preview emulator image
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 52/100
Direzione di ricerca
Inizia da CosmosDBNoSQLEndpointContainer.start(), _wait_until_ready(), _download_cert() e _wait_for_query_success(), quindi riproduci i problemi elencati con l'immagine vnext-preview. Confronta il comportamento relativo a protocollo, disponibilità, certificati, tentativi e individuazione degli endpoint con quello dell'immagine standard. Il lavoro è completato quando il container supporta l'immagine vnext-preview senza la sottoclasse di workaround, preservando il comportamento dell'immagine standard.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
The CosmosDBNoSQLEndpointContainer was built for the standard Cosmos DB emulator image (latest tag). It does not work with the vnext-preview image (mcr.microsoft.com/cosmosdb/linux/azure-cosmos-emulator:vnext-preview), which is the newer Linux-native emulator
Both images serve the same NoSQL API, but vnext has different runtime behavior that breaks assumptions in the current module.
What breaks
-
vnext defaults to HTTP — the standard image defaults to HTTPS, which is what
urland_wait_until_readyhardcode. vnext needs--protocol httpspassed as a command to opt into HTTPS. There is no way to configure this through the module. -
No Data Explorer on vnext —
_wait_until_ready()pollshttps://localhost:8081/_explorer/index.htmlas a readiness signal. vnext returns 400 on that path, so the check loops for 120s and times out. -
No PEM certificate on vnext —
start()calls_download_cert()looking for a file at the legacy Windows-style path inside the container. vnext does not write a cert there, so this raisesdocker.errors.NotFound. -
503s during startup are not retried — After the container is up, vnext returns
CosmosHttpResponseError(503, "pgcosmos extension is still starting") for a few seconds before it can serve queries._wait_for_query_successonly catchesServiceRequestError(connection-level errors), so it does not retry on 503. -
Endpoint discovery returns internal port — The emulator advertises
https://127.0.0.1:8081in its discovery response regardless of how ports are mapped. Usingbind_ports=Falsecauses the SDK to connect to the wrong port after discovery. Related: https://github.com/Azure/azure-cosmos-db-emulator-docker/issues/160
Current workaround
I wrote a subclass that overrides start(), _wait_until_ready(), and _wait_for_query_success() — it passes --protocol https as a command, skips the cert download and explorer check, and catches 503s during readiness polling. It works but depends on the internal class hierarchy, which makes it fragile.
Suggestion
Some ideas:
- Add a
protocolparameter (http/https) to control the URL scheme and pass the right startup command for vnext. - Make
_wait_until_ready()skip the explorer URL check when it returns 400 or is not available. Relying on_wait_for_query_successalone is sufficient. - Make
_download_cert()optional or catchNotFoundgracefully — for vnext there is no cert to download. - Add
CosmosHttpResponseErrorto the retry decorator in_wait_for_query_success.
Alternatively, a dedicated vnext-aware container class would keep things clean.
Versions
- testcontainers 4.14.2
- Python 3.13
- Image:
mcr.microsoft.com/cosmosdb/linux/azure-cosmos-emulator:vnext-preview
- Lingua principale
- Python
- Stelle
- 2.3k
- Fork
- 397
- Merge medio
- 8g 16h
- PR unite (30g)
- 5
Preparare l'ambiente
Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.
- Include un Dockerfile o un file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di testcontainers/testcontainers-python
-
Feature: Stream bytes out on copy_from_containerForse già presa @archit15singh l’ha presa 12 giorni fa. Aperta🚀 enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 67/100
-
Bug: HttpWaitStrategy ignores response predicates for accepted HTTP error statusesForse già presa @PranavMulakala l’ha presa 41 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
-
Bug: LogMessageWaitStrategy: a container that exits before its message raises without its logs, and __enter__ then removes the containerForse già presa @granzer69 l’ha presa 42 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
-
Updating the documentationAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 67/100
testcontainers/testcontainers-python#1086 · 1 commento ·
-
Bug: [minio] _healthcheck calls for nested wait_container_is_ready resulting in long wait timeAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
testcontainers/testcontainers-python#578 · 5 commenti ·
Tutte le issue di testcontainers/testcontainers-python
Issue simili
-
新功能建议
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
Mai-with-u/MaiBot#2583 ·
I maintainer di solito rispondono entro 1 giorno
-
area-integrations
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 1 giorno
-
[New]: JambaApertaMatch Play
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 63/100
privacyguides/verified-apps#9224 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
[Bug]: The docs check fails to install the Mintlify CLI when it runs right after a `mint` releaseApertachore upstream
Difficoltà 2/5 1-3 ore Idoneità per principianti 64/100
MemMachine/MemMachine#2032 ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 79/100