Skip to content

Commit dde205f

Browse files
committed
fix: Check log message before calling health API
1 parent f2736d5 commit dde205f

4 files changed

Lines changed: 4 additions & 34 deletions

File tree

src/Testcontainers.EventHubs/EventHubsBuilder.cs

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,8 @@ protected override EventHubsBuilder Init()
169169
.WithPortBinding(EventHubsPort, true)
170170
.WithPortBinding(EventHubsHttpPort, true)
171171
.WithWaitStrategy(Wait.ForUnixContainer()
172-
.AddCustomWaitStrategy(new WorkaroundGhIssue69())
172+
// https://github.com/Azure/azure-event-hubs-emulator-installer/issues/69#issuecomment-3762895979.
173+
.UntilMessageIsLogged("Emulator Service is Successfully Up!")
173174
.UntilHttpRequestIsSucceeded(request =>
174175
request.ForPort(EventHubsHttpPort).ForPath("/health")));
175176
}
@@ -191,19 +192,4 @@ protected override EventHubsBuilder Merge(EventHubsConfiguration oldValue, Event
191192
{
192193
return new EventHubsBuilder(new EventHubsConfiguration(oldValue, newValue));
193194
}
194-
195-
/// <summary>
196-
/// See GH issue: https://github.com/Azure/azure-event-hubs-emulator-installer/issues/69#issuecomment-3762895979.
197-
/// </summary>
198-
private sealed class WorkaroundGhIssue69 : IWaitUntil
199-
{
200-
/// <inheritdoc />
201-
public async Task<bool> UntilAsync(IContainer container)
202-
{
203-
await Task.Delay(TimeSpan.FromSeconds(5))
204-
.ConfigureAwait(false);
205-
206-
return true;
207-
}
208-
}
209195
}

src/Testcontainers.EventHubs/Usings.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
global using System.Linq;
66
global using System.Text;
77
global using System.Text.Json;
8-
global using System.Threading.Tasks;
98
global using Docker.DotNet.Models;
109
global using DotNet.Testcontainers;
1110
global using DotNet.Testcontainers.Builders;

src/Testcontainers.ServiceBus/ServiceBusBuilder.cs

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,8 @@ protected override ServiceBusBuilder Init()
165165
.WithPortBinding(ServiceBusHttpPort, true)
166166
.WithEnvironment("SQL_WAIT_INTERVAL", "0")
167167
.WithWaitStrategy(Wait.ForUnixContainer()
168-
.AddCustomWaitStrategy(new WorkaroundGhIssue69())
168+
// https://github.com/Azure/azure-event-hubs-emulator-installer/issues/69#issuecomment-3762895979.
169+
.UntilMessageIsLogged("Emulator Service is Successfully Up!")
169170
.UntilHttpRequestIsSucceeded(request =>
170171
request.ForPort(ServiceBusHttpPort).ForPath("/health")));
171172
}
@@ -187,19 +188,4 @@ protected override ServiceBusBuilder Merge(ServiceBusConfiguration oldValue, Ser
187188
{
188189
return new ServiceBusBuilder(new ServiceBusConfiguration(oldValue, newValue));
189190
}
190-
191-
/// <summary>
192-
/// See GH issue: https://github.com/Azure/azure-event-hubs-emulator-installer/issues/69#issuecomment-3762895979.
193-
/// </summary>
194-
private sealed class WorkaroundGhIssue69 : IWaitUntil
195-
{
196-
/// <inheritdoc />
197-
public async Task<bool> UntilAsync(IContainer container)
198-
{
199-
await Task.Delay(TimeSpan.FromSeconds(5))
200-
.ConfigureAwait(false);
201-
202-
return true;
203-
}
204-
}
205191
}

src/Testcontainers.ServiceBus/Usings.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
global using System.Diagnostics.CodeAnalysis;
44
global using System.IO;
55
global using System.Linq;
6-
global using System.Threading.Tasks;
76
global using Docker.DotNet.Models;
87
global using DotNet.Testcontainers.Builders;
98
global using DotNet.Testcontainers.Configurations;

0 commit comments

Comments
 (0)