diff --git a/src/Testcontainers.EventHubs/EventHubsBuilder.cs b/src/Testcontainers.EventHubs/EventHubsBuilder.cs index 32e3c9413..0fce024f6 100644 --- a/src/Testcontainers.EventHubs/EventHubsBuilder.cs +++ b/src/Testcontainers.EventHubs/EventHubsBuilder.cs @@ -169,7 +169,8 @@ protected override EventHubsBuilder Init() .WithPortBinding(EventHubsPort, true) .WithPortBinding(EventHubsHttpPort, true) .WithWaitStrategy(Wait.ForUnixContainer() - .AddCustomWaitStrategy(new WorkaroundGhIssue69()) + // https://github.com/Azure/azure-event-hubs-emulator-installer/issues/69#issuecomment-3762895979. + .UntilMessageIsLogged("Emulator Service is Successfully Up!") .UntilHttpRequestIsSucceeded(request => request.ForPort(EventHubsHttpPort).ForPath("/health"))); } @@ -191,19 +192,4 @@ protected override EventHubsBuilder Merge(EventHubsConfiguration oldValue, Event { return new EventHubsBuilder(new EventHubsConfiguration(oldValue, newValue)); } - - /// - /// See GH issue: https://github.com/Azure/azure-event-hubs-emulator-installer/issues/69#issuecomment-3762895979. - /// - private sealed class WorkaroundGhIssue69 : IWaitUntil - { - /// - public async Task UntilAsync(IContainer container) - { - await Task.Delay(TimeSpan.FromSeconds(5)) - .ConfigureAwait(false); - - return true; - } - } } \ No newline at end of file diff --git a/src/Testcontainers.EventHubs/Usings.cs b/src/Testcontainers.EventHubs/Usings.cs index 20239ef4f..7a143d9cb 100644 --- a/src/Testcontainers.EventHubs/Usings.cs +++ b/src/Testcontainers.EventHubs/Usings.cs @@ -5,7 +5,6 @@ global using System.Linq; global using System.Text; global using System.Text.Json; -global using System.Threading.Tasks; global using Docker.DotNet.Models; global using DotNet.Testcontainers; global using DotNet.Testcontainers.Builders; diff --git a/src/Testcontainers.ServiceBus/ServiceBusBuilder.cs b/src/Testcontainers.ServiceBus/ServiceBusBuilder.cs index 93d1354a9..03aa2df0f 100644 --- a/src/Testcontainers.ServiceBus/ServiceBusBuilder.cs +++ b/src/Testcontainers.ServiceBus/ServiceBusBuilder.cs @@ -164,8 +164,11 @@ protected override ServiceBusBuilder Init() .WithPortBinding(ServiceBusPort, true) .WithPortBinding(ServiceBusHttpPort, true) .WithEnvironment("SQL_WAIT_INTERVAL", "0") - .WithWaitStrategy(Wait.ForUnixContainer().UntilHttpRequestIsSucceeded(request => - request.ForPort(ServiceBusHttpPort).ForPath("/health"))); + .WithWaitStrategy(Wait.ForUnixContainer() + // https://github.com/Azure/azure-event-hubs-emulator-installer/issues/69#issuecomment-3762895979. + .UntilMessageIsLogged("Emulator Service is Successfully Up!") + .UntilHttpRequestIsSucceeded(request => + request.ForPort(ServiceBusHttpPort).ForPath("/health"))); } ///