Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 2 additions & 16 deletions src/Testcontainers.EventHubs/EventHubsBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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")));
}
Expand All @@ -191,19 +192,4 @@ protected override EventHubsBuilder Merge(EventHubsConfiguration oldValue, Event
{
return new EventHubsBuilder(new EventHubsConfiguration(oldValue, newValue));
}

/// <summary>
/// See GH issue: https://github.com/Azure/azure-event-hubs-emulator-installer/issues/69#issuecomment-3762895979.
/// </summary>
private sealed class WorkaroundGhIssue69 : IWaitUntil
{
/// <inheritdoc />
public async Task<bool> UntilAsync(IContainer container)
{
await Task.Delay(TimeSpan.FromSeconds(5))
.ConfigureAwait(false);

return true;
}
}
}
1 change: 0 additions & 1 deletion src/Testcontainers.EventHubs/Usings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
7 changes: 5 additions & 2 deletions src/Testcontainers.ServiceBus/ServiceBusBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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")));
}

/// <inheritdoc />
Expand Down