Skip to content

Commit c91ba4f

Browse files
committed
increase max containers in cosmos
Signed-off-by: Gerd Oberlechner <[email protected]>
1 parent 344ea26 commit c91ba4f

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

test-integration/hack/start-cosmos-emulator-vnext.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff 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 \

test-integration/hack/start-cosmos-emulator.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff 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
3434
fi
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+
3640
echo "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
4651
echo "Waiting for Cosmos DB emulator to be ready..."
4752
for 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..."

0 commit comments

Comments
 (0)