Skip to content

Commit 2fb2865

Browse files
authored
fix(nats): use wait for listening port instead of wait for log (#3256)
* nats.go update wait for log less error prone log message * check for both port and log * single check is sufficient
1 parent 52541b5 commit 2fb2865

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

modules/nats/nats.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ type NATSContainer struct {
2424
// Deprecated: use Run instead
2525
// RunContainer creates an instance of the NATS container type
2626
func RunContainer(ctx context.Context, opts ...testcontainers.ContainerCustomizer) (*NATSContainer, error) {
27-
return Run(ctx, "nats:2.9", opts...)
27+
return Run(ctx, "nats:2.11.7", opts...)
2828
}
2929

3030
// Run creates an instance of the NATS container type
@@ -33,7 +33,7 @@ func Run(ctx context.Context, img string, opts ...testcontainers.ContainerCustom
3333
Image: img,
3434
ExposedPorts: []string{defaultClientPort, defaultRoutingPort, defaultMonitoringPort},
3535
Cmd: []string{"-DV", "-js"},
36-
WaitingFor: wait.ForLog("Listening for client connections on 0.0.0.0:4222"),
36+
WaitingFor: wait.ForListeningPort(defaultClientPort),
3737
}
3838

3939
genericContainerReq := testcontainers.GenericContainerRequest{

0 commit comments

Comments
 (0)