@@ -309,9 +309,9 @@ def test_operator_restart(self, manifest, service, version=None):
309309 check_operator_restart (
310310 chi = chi ,
311311 wait_objects = {
312- "statefulset" : 2 ,
313- "pod" : 2 ,
314- "service" : 3 ,
312+ "statefulset" : shards * replicas ,
313+ "pod" : shards * replicas ,
314+ "service" : shards * replicas + 1 ,
315315 },
316316 pod = f"chi-{ chi } -{ cluster } -0-0-0"
317317 )
@@ -334,10 +334,11 @@ def test_operator_restart(self, manifest, service, version=None):
334334 kubectl .delete_chi (chi )
335335
336336
337- def get_replicas_from_remote_servers (chi , cluster ):
337+ def get_replicas_from_remote_servers (chi , cluster , shell = None ):
338338 if cluster == "" :
339339 cluster = chi
340- remote_servers = kubectl .get ("configmap" , f"chi-{ chi } -common-configd" )["data" ]["chop-generated-remote_servers.xml" ]
340+
341+ remote_servers = kubectl .get ("configmap" , f"chi-{ chi } -common-configd" , shell = shell )["data" ]["chop-generated-remote_servers.xml" ]
341342
342343 chi_start = remote_servers .find (f"<{ cluster } >" )
343344 chi_end = remote_servers .find (f"</{ cluster } >" )
@@ -422,12 +423,9 @@ def test_010008_3(self):
422423 create_shell_namespace_clickhouse_template ()
423424
424425 manifest = "manifests/chi/test-008-operator-restart-3-1.yaml"
425- manifest_2 = "manifests/chi/test-008-operator-restart-3-2.yaml"
426426 chi = yaml_manifest .get_name (util .get_full_path (manifest ))
427427 cluster = chi
428428
429- util .require_keeper (keeper_type = self .context .keeper_type )
430-
431429 full_cluster = {"statefulset" : 4 , "pod" : 4 , "service" : 5 }
432430
433431 with Given ("4-node CHI creation started" ):
@@ -436,7 +434,7 @@ def test_010008_3(self):
436434 manifest ,
437435 check = {
438436 "apply_templates" : {
439- "manifests/chit/tpl-persistent-volume-100Mi.yaml" ,
437+ current (). context . clickhouse_template ,
440438 },
441439 "pod_count" : 2 ,
442440 "do_not_delete" : 1 ,
@@ -456,36 +454,6 @@ def test_010008_3(self):
456454 kubectl .wait_objects (chi , full_cluster )
457455 kubectl .wait_chi_status (chi , "Completed" )
458456
459- with Then ("Upgrade ClickHouse version to run a reconcile" ):
460- kubectl .create_and_check (manifest_2 , check = {"do_not_delete" : 1 , "chi_status" : "InProgress" })
461-
462- trigger_event = threading .Event ()
463-
464- with When ("I create new shells" ):
465- shell_1 = get_shell ()
466- shell_2 = get_shell ()
467-
468- Check ("Check that cluster definition does not change during restart" , test = check_remote_servers , parallel = True )(
469- chi = chi ,
470- check_shards = True ,
471- check_replicas = False ,
472- trigger_event = trigger_event ,
473- shell = shell_1
474- )
475- # Just wait for restart operator. After restart it will update cluster with new ClickHouse version
476- wait_operator_restart (
477- chi = chi ,
478- wait_objects = {"statefulset" : 4 , "pod" : 4 , "service" : 5 },
479- shell = shell_2
480- )
481- trigger_event .set ()
482- time .sleep (5 ) # let threads to finish
483- join ()
484-
485- # with Then("I recreate shell"):
486- # shell = get_shell()
487- # self.context.shell = shell
488-
489457 with Finally ("I clean up" ):
490458 delete_test_namespace ()
491459
0 commit comments