11*** Settings ***
2- Documentation Check scaledown replica
2+ Documentation Check delete master
33Library Collections
44Library OperatingSystem
55Library String
@@ -10,25 +10,25 @@ Resource ../Lib/lib.robot
1010Check Delete Master
1111 [Tags] patroni full check_delete_master
1212 Run Keyword Checks Before Tests
13+
1314 ${MASTER } = Get Master Pod
14- # insert test records
15+ ${OLD_MASTER_NAME } = Set Variable ${MASTER.metadata.name }
16+
17+ # insert test records before deleting master
1518 ${RID } ${EXPECTED } = Insert Test Record ${MASTER.status.pod_ip }
16- # delete mater pod
17- Log To Console Deleting Master Pod "${MASTER.metadata.name } "
18- Run Keyword Delete Pod ${MASTER.metadata.name } 30
19- # wait new master
20- Log To Console Wait new master election keyword
21- Wait Until Keyword Succeeds 120 sec 1 sec Check If New Master Elected ${ MASTER.metadata.name }
22- # wait while all replicas back
23- Wait Until Keyword Succeeds 120 sec 1 sec Check Replica Count
19+
20+ Log To Console Deleting Master Pod "${OLD_MASTER_NAME } "
21+ Run Keyword Delete Pod ${OLD_MASTER_NAME } 30
22+
23+ Log To Console Wait until cluster recovers after master deletion
24+ Wait Until Keyword Succeeds 300 sec 5 sec Wait Replica Pods In Up State
25+ Wait Until Keyword Succeeds 300 sec 5 sec Check Replica Count
26+
2427 ${NEW_MASTER } = Get Master Pod
25- Log To Console New Master ${NEW_MASTER.metadata.name }
26- # wait new replica pod is up
27- Wait Until Keyword Succeeds 120 sec 2 sec Wait Replica Pods In Up State
28- # check master not read-only
29- Log To Console Test New Master Works
30- Wait Until Keyword Succeeds ${120 } 1 sec Insert Test Record ${NEW_MASTER.status.pod_ip }
31- # check existance unavaliabled replicas
32- Run Keyword Check Replica Count
33- # check replication again, becouse it is simple! :)
34- Run Keyword Replication Works
28+ Log To Console Current Master ${NEW_MASTER.metadata.name }
29+
30+ Log To Console Test Current Master Works
31+ Wait Until Keyword Succeeds 300 sec 5 sec Insert Test Record ${NEW_MASTER.status.pod_ip }
32+
33+ Wait Until Keyword Succeeds 300 sec 5 sec Check Replica Count
34+ Wait Until Keyword Succeeds 300 sec 5 sec Replication Works
0 commit comments