@@ -465,8 +465,6 @@ def test_1_verify_provided_options(self):
465
465
466
466
467
467
def test_2_update_bootstrap_config (self ):
468
- [old_pod ] = kutil .ls_po (self .ns , pattern = "mycluster-router-.*" )
469
-
470
468
patch = {
471
469
"spec" : {
472
470
"router" : {
@@ -476,18 +474,15 @@ def test_2_update_bootstrap_config(self):
476
474
}
477
475
}
478
476
}
477
+ waiter = tutil .get_deploy_rollover_update_waiter (self , "mycluster" , timeout = 300 , delay = 5 )
479
478
kutil .patch_ic (self .ns , "mycluster" , patch , type = "merge" )
480
-
481
- self .wait_pod_gone (old_pod ["NAME" ], ns = self .ns )
482
- self .wait_routers ("mycluster-router-.*" , 1 )
479
+ waiter ()
483
480
484
481
[new_pod ] = kutil .ls_po (self .ns , pattern = "mycluster-router-.*" )
485
482
router_config = kutil .cat (self .ns , new_pod ["NAME" ], "/tmp/mysqlrouter/mysqlrouter.conf" )
486
483
self .assertIn (b"name=othername" , router_config , "router config does not contain the name" )
487
484
488
485
def test_3_update_config (self ):
489
- [old_pod ] = kutil .ls_po (self .ns , pattern = "mycluster-router-.*" )
490
-
491
486
patch = {
492
487
"spec" : {
493
488
"router" : {
@@ -497,10 +492,9 @@ def test_3_update_config(self):
497
492
}
498
493
}
499
494
}
495
+ waiter = tutil .get_deploy_rollover_update_waiter (self , "mycluster" , timeout = 300 , delay = 5 )
500
496
kutil .patch_ic (self .ns , "mycluster" , patch , type = "merge" )
501
-
502
- self .wait_pod_gone (old_pod ["NAME" ], ns = self .ns )
503
- self .wait_routers ("mycluster-router-.*" , 1 )
497
+ waiter ()
504
498
505
499
[new_pod ] = kutil .ls_po (self .ns , pattern = "mycluster-router-.*" )
506
500
self .assertTrue (kutil .file_exists (self .ns , new_pod ["NAME" ], "/tmp/with`backtick" ))
@@ -524,6 +518,7 @@ def test_5_add_routing_options(self):
524
518
}
525
519
}
526
520
kutil .patch_ic (self .ns , "mycluster" , patch , type = "merge" )
521
+ sleep (5 )
527
522
routing_options = get_routing_options (self .ns , "mycluster-0" )
528
523
rules = routing_options ["configuration" ]["routing_rules" ]
529
524
self .assertEqual (rules ["read_only_targets" ], "read_replicas" )
@@ -538,6 +533,7 @@ def test_6_remove_routing_options(self):
538
533
}
539
534
}
540
535
kutil .patch_ic (self .ns , "mycluster" , patch , type = "merge" )
536
+ sleep (5 )
541
537
routing_options = get_routing_options (self .ns , "mycluster-0" )
542
538
rules = routing_options ["configuration" ]["routing_rules" ]
543
539
self .assertEqual (rules ["read_only_targets" ], "secondaries" )
0 commit comments