@@ -28,6 +28,10 @@ const (
2828 coherenceImageEnvVar string = "TEST_COHERENCE_IMAGE"
2929 coherencePort = "1408/tcp"
3030 coherencePort2 = "30000/tcp"
31+
32+ // configuration for the health check
33+ coherenceHealthEnvVar = "COHERENCE_HEALTH_HTTP_PORT"
34+ coherenceHealthPort = "6676"
3135)
3236
3337func newTestConfig (t testing.TB ) Config {
@@ -42,10 +46,15 @@ func newTestConfig(t testing.TB) Config {
4246
4347 c , err := testcontainers .Run (ctx ,
4448 img ,
45- testcontainers .WithExposedPorts (coherencePort , coherencePort2 ),
49+ testcontainers .WithExposedPorts (coherencePort , coherencePort2 , coherenceHealthPort ),
50+ testcontainers .WithEnv (map [string ]string {
51+ coherenceHealthEnvVar : coherenceHealthPort ,
52+ }),
4653 testcontainers .WithWaitStrategy (
4754 wait .ForListeningPort (coherencePort ),
4855 wait .ForListeningPort (coherencePort2 ),
56+ wait .ForListeningPort (coherenceHealthPort + "/tcp" ),
57+ wait .ForHTTP ("/ready" ).WithPort (coherenceHealthPort + "/tcp" ).WithStartupTimeout (time .Second * 30 ),
4958 ),
5059 )
5160 testcontainers .CleanupContainer (t , c )
0 commit comments