File tree Expand file tree Collapse file tree 1 file changed +15
-2
lines changed
src/Testcontainers.Milvus Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -59,6 +59,9 @@ public override MilvusContainer Build()
5959 /// <inheritdoc />
6060 protected override MilvusBuilder Init ( )
6161 {
62+ // Imitate what is done in the official script
63+ // https://github.com/milvus-io/milvus/blob/2134f83aa34bfbcc3750d69c4874adca5dd85d62/scripts/standalone_embed.sh#L43
64+
6265 return base . Init ( )
6366 . WithImage ( MilvusImage )
6467 . WithPortBinding ( MilvusManagementPort , true )
@@ -71,8 +74,18 @@ protected override MilvusBuilder Init()
7174 . WithEnvironment ( "ETCD_CONFIG_PATH" , MilvusEtcdConfigFilePath )
7275 . WithEnvironment ( "ETCD_DATA_DIR" , "/var/lib/milvus/etcd" )
7376 . WithResourceMapping ( EtcdConfig , MilvusEtcdConfigFilePath )
74- . WithWaitStrategy ( Wait . ForUnixContainer ( ) . UntilHttpRequestIsSucceeded ( request =>
75- request . ForPort ( MilvusManagementPort ) . ForPath ( "/healthz" ) ) ) ;
77+ . WithCreateParameterModifier ( p =>
78+ {
79+ p . Healthcheck = new HealthcheckConfig
80+ {
81+ Test = [ "CMD-SHELL" , $ "curl -f http://localhost:{ MilvusManagementPort } /healthz"] ,
82+ Interval = TimeSpan . FromSeconds ( 30 ) ,
83+ StartPeriod = 90 * 1_000_000_000L , // 90s
84+ Timeout = TimeSpan . FromSeconds ( 20 ) ,
85+ Retries = 3 ,
86+ } ;
87+ } )
88+ . WithWaitStrategy ( Wait . ForUnixContainer ( ) . UntilContainerIsHealthy ( ) ) ;
7689 }
7790
7891 /// <inheritdoc />
You can’t perform that action at this time.
0 commit comments