aspire: Azure ServiceBus emulator is not reliable in CI

When running tests that use the ServiceBus emulator in CI, we are randomly getting failures with the sqledge container not starting successfully.

Examples:

Or when running Azure Functions playground app in the Playground.Tests:

https://dev.azure.com/dnceng-public/public/_build/results?buildId=913500

https://helixr1107v0xdeko0k025g8.blob.core.windows.net/dotnet-aspire-refs-pull-7048-merge-464d941387084146a7/Aspire.Playground.Tests/1/console.b2dd2d1b.log?skoid=8eda00af-b5ec-4be9-b69b-0919a2338892&sktid=72f988bf-86f1-41af-91ab-2d7cd011db47&skt=2025-01-10T21%3A46%3A19Z&ske=2025-01-10T22%3A46%3A19Z&sks=b&skv=2024-11-04&sv=2024-11-04&st=2025-01-10T21%3A46%3A19Z&se=2025-01-10T22%3A46%3A19Z&sr=c&sp=r&sig=cVb5usSQfhF3fv1uoy5lsT2h8kI84vS5kwfTop3fooY%3D

After the tests exit we see:

+ docker container ls --all
CONTAINER ID   IMAGE                                                         COMMAND                  CREATED          STATUS                        PORTS                                                                                NAMES
a1c98b3a374c   mcr.microsoft.com/azure-sql-edge:latest                       "/opt/mssql/bin/perm…"   18 minutes ago   Exited (1) 16 minutes ago                                                                                          messaging-sqledge-egpcscww-23011b3d
7fbf12f93e41   mcr.microsoft.com/azure-storage/azurite:3.33.0                "docker-entrypoint.s…"   18 minutes ago   Up 18 minutes                 127.0.0.1:32778->10000/tcp, 127.0.0.1:32777->10001/tcp, 127.0.0.1:32776->10002/tcp   storage-bcfuwrtt-23011b3d
4a860a4604a6   mcr.microsoft.com/azure-storage/azurite:3.33.0                "docker-entrypoint.s…"   18 minutes ago   Up 18 minutes                 127.0.0.1:32775->10000/tcp, 127.0.0.1:32774->10001/tcp, 127.0.0.1:32773->10002/tcp   eventhubs-storage-sbbpjwnj-23011b3d
9cebcc692cdc   mcr.microsoft.com/azure-storage/azurite:3.33.0                "docker-entrypoint.s…"   18 minutes ago   Up 18 minutes                 127.0.0.1:32772->10000/tcp, 127.0.0.1:32771->10001/tcp, 127.0.0.1:32770->10002/tcp   funcstoragefefd5-ygpmurne-23011b3d
78bbb652aed2   mcr.microsoft.com/azure-messaging/servicebus-emulator:1.0.1   "/ServiceBus_Emulato…"   18 minutes ago   Exited (139) 15 minutes ago                                                                                        messaging-xqynaftj-23011b3d
3e9c359800ac   mcr.microsoft.com/azure-messaging/eventhubs-emulator:latest   "/Eventhubs_Emulator…"   18 minutes ago   Up 18 minutes                 8080/tcp, 127.0.0.1:32768->5672/tcp                                                  eventhubs-mcxdyvzj-23011b3d

These tests are being disabled until we can find out why they fail randomly and can be made stable.

About this issue

  • Original URL
  • State: open
  • Created 2 years ago
  • Comments: 15 (14 by maintainers)

Commits related to this issue

Most upvoted comments

sql-edge doesn’t work at all for me, since I’m on arm. Changed it to mssql - works flawlessly for me.

builder.AddAzureServiceBus("messaging")
    .RunAsEmulator(resourceBuilder =>
    {
        var edge = resourceBuilder.ApplicationBuilder.Resources.OfType<ContainerResource>()
            .First(resource => resource.Name.EndsWith("-sqledge"));
        
        var annotation = edge.Annotations.OfType<ContainerImageAnnotation>().First(); 
        
        annotation.Image = "mssql/server";
        annotation.Tag = "2022-latest";
    })

Why is it even set to sql edge? Is there some real advantage in using it over mssql?

Ok, so “retries” would be a better fit for this one. What retry-capabilities do we have access to now, with the move to MTP?

I was made aware of https://learn.microsoft.com/dotnet/core/testing/microsoft-testing-platform-extensions-policy but I haven’t had a chance look beyond the docs.