File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed
Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -39,6 +39,7 @@ ${CONTAINER_RUNTIME} run \
3939 --publish 8081:8081 \
4040 --publish 10250-10255:10250-10255 \
4141 -e AZURE_COSMOS_EMULATOR_IP_ADDRESS_OVERRIDE=127.0.0.1 \
42+ -e AZURE_COSMOS_EMULATOR_PARTITION_COUNT=25 \
4243 -e PROTOCOL=https \
4344 --name " ${CONTAINER_NAME} " \
4445 --detach \
Original file line number Diff line number Diff line change @@ -33,24 +33,30 @@ if ${CONTAINER_RUNTIME} ps -q --filter "name=local-cosmos-emulator-*" | grep -q
3333 ${CONTAINER_RUNTIME} ps -aq --filter " name=local-cosmos-emulator-*" | xargs -r ${CONTAINER_RUNTIME} rm
3434fi
3535
36+ # number of partitions to use for the emulator
37+ # increase if a lot of tests run in parallel and start failing with 503 errors
38+ PARTITION_COUNT=50
39+
3640echo " Starting Cosmos DB emulator with container name: ${CONTAINER_NAME} "
3741${CONTAINER_RUNTIME} run \
3842 --publish 8081:8081 \
3943 --publish 10250-10255:10250-10255 \
4044 -e AZURE_COSMOS_EMULATOR_IP_ADDRESS_OVERRIDE=127.0.0.1 \
45+ -e AZURE_COSMOS_EMULATOR_PARTITION_COUNT=${PARTITION_COUNT} \
4146 --name " ${CONTAINER_NAME} " \
4247 --detach \
4348 mcr.microsoft.com/cosmosdb/linux/azure-cosmos-emulator:latest
4449
4550# Wait for emulator to be ready by checking logs
4651echo " Waiting for Cosmos DB emulator to be ready..."
4752for i in {1..60}; do
48- if ${CONTAINER_RUNTIME} logs " ${CONTAINER_NAME} " 2>&1 | grep -q " Started 11/11 partitions" ; then
53+ if ${CONTAINER_RUNTIME} logs " ${CONTAINER_NAME} " 2>&1 | grep -q " Started ${PARTITION_COUNT+1} / ${PARTITION_COUNT+1} partitions" ; then
4954 echo " Cosmos DB emulator is ready!"
5055 break
5156 fi
5257 if [ " $i " -eq 60 ]; then
5358 echo " Timeout waiting for Cosmos DB emulator to be ready"
59+ ${CONTAINER_RUNTIME} logs " ${CONTAINER_NAME} "
5460 exit 1
5561 fi
5662 echo " Attempt $i /60: Waiting for emulator to start all partitions..."
You can’t perform that action at this time.
0 commit comments