Closed rylewell-msft closed 5 years ago
@rylewell-msft Thank you for this detailed question. By container are you referring to Database + Collection specified in the RunSettings? In this example test project, there is a bit of code that does a cleanup task so the database + collection are removed:
` [TestCleanup()]
public void Cleanup()
{
DocumentDBRepository<Item>.Teardown();`
Does this answer your question?
Sorry, I forgot container means something specific to CosmosDB :) By container, I'm referring to the docker container that the emulator is running within. I'm hoping that the docker container is guaranteed to die at the end of the pipeline, such that any subsequent use of the same build agent does not get an emulator with data potentially already in it.
@rylewell-msft In this specific example, the build container's lifespan is per build, as the CI/CD pipeline definition is to fetch the Docker image containing the emulator each time the pipeline executes. Although this document is not very clear, there is another very helpful document that explains this further: Build, test, and push Docker container apps in Azure Pipelines. The Troubleshooting section details the following:
Please let me know if you have additional questions.
@rylewell-msft We will now proceed to close this thread. If there are further questions regarding this matter, please comment and we will gladly continue the discussion.
Assuming I've got a non-ephemeral build agent (non hosted pool) - when does the container die? Will it stay running after the pipeline completes? Will subsequent tests re-use the same container with the same state?
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.