Replies: 2 comments 3 replies
-
If the current wait strategy is not compatible with the new (preview) tag, this is exactly what you’ll notice.
Yes, if the upcoming version contains breaking changes.
I think the best we can do is figure out what changes are needed to be compatible with the upcoming update and are ready to publish a fix as soon as possible (at least provide guidance as a workaround, like overriding the default builder configuration). |
Beta Was this translation helpful? Give feedback.
-
This is how to get the container running: _container = new CosmosDbBuilder()
.WithImage("mcr.microsoft.com/cosmosdb/linux/azure-cosmos-emulator:vnext-preview")
.WithCommand("--protocol", "https")
.WithEnvironment("ENABLE_EXPLORER", "false")
.WithWaitStrategy(Wait.ForUnixContainer().AddCustomWaitStrategy(new WaitUntil()))
.Build(); The private sealed class WaitUntil : IWaitUntil
{
public async Task<bool> UntilAsync(IContainer container)
{
// CosmosDB's preconfigured HTTP client will redirect the request to the container.
const string requestUri = "https://localhost";
var httpClient = ((CosmosDbContainer)container).HttpClient;
try
{
using var httpResponse = await httpClient.GetAsync(requestUri).ConfigureAwait(false);
return httpResponse.IsSuccessStatusCode;
}
catch (Exception)
{
return false;
}
finally
{
httpClient.Dispose();
}
}
} Note: this new emulator doesn't yet support everything the old one does. |
Beta Was this translation helpful? Give feedback.
-
Microsoft has released a new docker image which fixes many of the many issues they had.
https://devblogs.microsoft.com/cosmosdb/introducing-the-new-linux-based-azure-cosmos-db-emulator-preview/
I gave it a try manually and it works better, it loads way faster.
However I tried to use it as a test container by providing a
.WithImage(imageNameAndTag)
And it doesn't work. It is as if test containers couldn't know when the container is up and running and it's stuck waiting.
I checked logs within container and its traces are very different than the previous versions' traces.
Does the current code need to change to support this image? Could it be changed to ensure it's backwards compatible?
Beta Was this translation helpful? Give feedback.
All reactions