Skip to content

Commit 78d1f94

Browse files
feat(ServiceBus): Replace wait strategy with HTTP health check
1 parent 76ce3e0 commit 78d1f94

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/Testcontainers.ServiceBus/ServiceBusBuilder.cs

+6-3
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ public sealed class ServiceBusBuilder : ContainerBuilder<ServiceBusBuilder, Serv
1212

1313
public const ushort ServiceBusPort = 5672;
1414

15+
public const ushort ServiceBusHttpPort = 5300;
16+
1517
/// <summary>
1618
/// Initializes a new instance of the <see cref="ServiceBusBuilder" /> class.
1719
/// </summary>
@@ -115,9 +117,10 @@ protected override ServiceBusBuilder Init()
115117
return base.Init()
116118
.WithImage(ServiceBusImage)
117119
.WithPortBinding(ServiceBusPort, true)
118-
.WithWaitStrategy(Wait.ForUnixContainer()
119-
.UntilMessageIsLogged("Emulator Service is Successfully Up!")
120-
.AddCustomWaitStrategy(new WaitTwoSeconds()));
120+
.WithPortBinding(ServiceBusHttpPort, true)
121+
.WithEnvironment("SQL_WAIT_INTERVAL", "0")
122+
.WithWaitStrategy(Wait.ForUnixContainer().UntilHttpRequestIsSucceeded(request =>
123+
request.ForPath("/health").ForPort(ServiceBusHttpPort)));
121124
}
122125

123126
/// <inheritdoc />

0 commit comments

Comments
 (0)