@@ -552,7 +552,7 @@ def test_compose_3idx1cm1dmc(self):
552552 container_count , rc = self .compose_up ()
553553 assert rc == 0
554554 # Wait for containers to come up
555- assert self .wait_for_containers (container_count , label = "com.docker.compose.project={}" .format (self .project_name ))
555+ assert self .wait_for_containers (container_count , label = "com.docker.compose.project={}" .format (self .project_name ), timeout = 900 )
556556 containers = self .client .containers (filters = {"label" : "com.docker.compose.project={}" .format (self .project_name )})
557557 self .check_dmc (containers , 4 , 3 , 2 , 1 , 5 )
558558
@@ -642,7 +642,7 @@ def test_compose_2idx2sh1cm(self):
642642 container_count , rc = self .compose_up ()
643643 assert rc == 0
644644 # Wait for containers to come up
645- assert self .wait_for_containers (container_count , label = "com.docker.compose.project={}" .format (self .project_name ))
645+ assert self .wait_for_containers (container_count , label = "com.docker.compose.project={}" .format (self .project_name ), timeout = 600 )
646646 # Get container logs
647647 container_mapping = {"sh1" : "sh" , "sh2" : "sh" , "idx1" : "idx" , "idx2" : "idx" , "cm1" : "cm" }
648648 for container in container_mapping :
@@ -687,25 +687,31 @@ def test_compose_2idx2sh1cm(self):
687687 assert len (idx_list ) == 0 and len (sh_list ) == 0
688688 # Add one more indexer
689689 self .compose_file_name = "2idx2sh1cm_idx3.yaml"
690- container_count , rc = self .compose_up ()
690+ _ , rc = self .compose_up ()
691691 assert rc == 0
692692 # Wait for containers to come up
693- assert self .wait_for_containers (container_count , name = "idx3" )
693+ assert self .wait_for_containers (container_count + 1 , label = "com.docker.compose.project={}" . format ( self . project_name ), timeout = 600 )
694694
695695 retries = 10
696696 for n in range (retries ):
697- status , content = self .handle_request_retry ("GET" , "https://localhost:{}/services/cluster/master/peers?output_mode=json" .format (splunkd_port ),
697+ try :
698+ status , content = self .handle_request_retry ("GET" , "https://localhost:{}/services/cluster/master/peers?output_mode=json" .format (splunkd_port ),
698699 {"auth" : ("admin" , self .password ), "verify" : False })
699- assert status == 200
700- output = json .loads (content )
701- for idx in output ["entry" ]:
702- if idx ["content" ]["label" ] == "idx3" and idx ["content" ]["status" ] == "Up" :
703- break
704- else :
700+ assert status == 200
701+ output = json .loads (content )
702+ assert len (output ["entry" ]) == 3
703+ indexers = []
704+ for idx in output ["entry" ]:
705+ indexers .append (idx ["content" ]["label" ])
706+ assert "idx1" in indexers
707+ assert "idx2" in indexers
708+ assert "idx3" in indexers
709+ break
710+ except Exception as err :
705711 time .sleep (10 )
706712 if n < retries - 1 :
707713 continue
708- assert False
714+ raise err
709715
710716 def test_compose_1deployment1cm (self ):
711717 self .project_name = self .generate_random_string ()
0 commit comments