@@ -552,7 +552,7 @@ def test_compose_3idx1cm1dmc(self):
552
552
container_count , rc = self .compose_up ()
553
553
assert rc == 0
554
554
# 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 )
556
556
containers = self .client .containers (filters = {"label" : "com.docker.compose.project={}" .format (self .project_name )})
557
557
self .check_dmc (containers , 4 , 3 , 2 , 1 , 5 )
558
558
@@ -642,7 +642,7 @@ def test_compose_2idx2sh1cm(self):
642
642
container_count , rc = self .compose_up ()
643
643
assert rc == 0
644
644
# 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 )
646
646
# Get container logs
647
647
container_mapping = {"sh1" : "sh" , "sh2" : "sh" , "idx1" : "idx" , "idx2" : "idx" , "cm1" : "cm" }
648
648
for container in container_mapping :
@@ -687,25 +687,31 @@ def test_compose_2idx2sh1cm(self):
687
687
assert len (idx_list ) == 0 and len (sh_list ) == 0
688
688
# Add one more indexer
689
689
self .compose_file_name = "2idx2sh1cm_idx3.yaml"
690
- container_count , rc = self .compose_up ()
690
+ _ , rc = self .compose_up ()
691
691
assert rc == 0
692
692
# 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 )
694
694
695
695
retries = 10
696
696
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 ),
698
699
{"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 :
705
711
time .sleep (10 )
706
712
if n < retries - 1 :
707
713
continue
708
- assert False
714
+ raise err
709
715
710
716
def test_compose_1deployment1cm (self ):
711
717
self .project_name = self .generate_random_string ()
0 commit comments