Hi stephanely,
you are facing a challenging issue with the Azure Cosmos DB Emulator on your build VM. Here are a few more steps that might help:
1.Optimize VM Resources:
Ensure your build VM has sufficient CPU and memory. Sometimes, increasing the VM size can help with performance and resource allocation.
2.Use Docker for Emulator:
Running the Cosmos DB Emulator in a Docker container can sometimes provide better isolation and resource management. You can pull the Docker image and run it with the following commands:
docker pull mcr.microsoft.com/cosmosdb/windows/azure-cosmos-emulator
docker run -p 8081:8081 -p 10251:10251 -p 10252:10252 -p 10253:10253 -p 10254:10254 mcr.microsoft.com/cosmosdb/windows/azure-cosmos-emulator
3.Reset Emulator Data:
If you haven't already, try resetting the emulator data. This can sometimes resolve issues with container limits:
Open the Azure Cosmos DB Emulator context menu from the system tray.
Select Reset Data.
4.Review Emulator Logs:
Check the emulator logs for any specific errors or warnings that might give more insight into the issue. Logs can be found in the %LOCALAPPDATA%\CosmosDBEmulator directory.
5.Consider Using Azure DevOps:
If you're using Azure DevOps, you can set up a CI/CD pipeline with the Azure Cosmos DB Emulator build task. This can help streamline the process and manage resources more effectively1.
6.Alternative Testing Strategies:
As a temporary measure, you might consider running a subset of your tests locally with the emulator and the full suite in the cloud. This can help balance the load and reduce the strain on the emulator.
I hope this information helps. Please do let us know if you have any further queries.