@@ -55,6 +55,7 @@ def setup(self):
5555
5656 self .pdisk_id = base_config .PDisk [1 ].PDiskId
5757 self .groups = [group for group in base_config .Group if group .StoragePoolId == 1 ]
58+ self .groups .sort (key = lambda g : g .GroupId )
5859 assert len (self .groups ) == 2
5960 for g in self .groups :
6061 assert len (g .VSlotId ) == 1
@@ -114,6 +115,7 @@ def http_get(self, url):
114115 def get_storage_groups (self ):
115116 response = self .http_get ('/storage/groups?fields_required=all&with=all' ).json ()
116117 groups = [group for group in response ['StorageGroups' ] if group ['PoolName' ] == self .pool_name ]
118+ groups .sort (key = lambda g : g ['GroupId' ])
117119 assert len (groups ) == 2
118120 for group in groups :
119121 vdisk = group ['VDisks' ][0 ]
@@ -147,11 +149,12 @@ def wait_whiteboard_updated():
147149 self .check_group (groups [1 ], expected_vdisk_weight = 1 , expected_num_active_slots = 3 )
148150 self .retriable (wait_whiteboard_updated )
149151
150- pdisk_info = self .get_pdisk_info ()
151- logger .info (json .dumps (pdisk_info , indent = 2 ))
152-
153- self .check_pdisk (pdisk_info ['Whiteboard' ]['PDisk' ], expected_num_active_slots = 3 )
154- self .check_pdisk (pdisk_info ['BSC' ]['PDisk' ], expected_num_active_slots = 3 , expected_slot_size_in_units = 0 )
152+ def wait_pdisk_info_updated ():
153+ pdisk_info = self .get_pdisk_info ()
154+ logger .info (json .dumps (pdisk_info , indent = 2 ))
155+ self .check_pdisk (pdisk_info ['Whiteboard' ]['PDisk' ], expected_num_active_slots = 3 )
156+ self .check_pdisk (pdisk_info ['BSC' ]['PDisk' ], expected_num_active_slots = 3 , expected_slot_size_in_units = 0 )
157+ self .retriable (wait_pdisk_info_updated )
155158
156159 def test_change_pdisk_slot_size_in_units (self ):
157160 self .change_pdisk_slot_size_in_units (slot_size_in_units = 2 )
@@ -164,8 +167,15 @@ def wait_whiteboard_updated():
164167 self .check_group (groups [1 ], expected_vdisk_weight = 2 , expected_num_active_slots = 3 )
165168 self .retriable (wait_whiteboard_updated )
166169
167- pdisk_info = self .get_pdisk_info ()
168- logger .info (json .dumps (pdisk_info , indent = 2 ))
169-
170- self .check_pdisk (pdisk_info ['Whiteboard' ]['PDisk' ], expected_num_active_slots = 3 )
171- self .check_pdisk (pdisk_info ['BSC' ]['PDisk' ], expected_num_active_slots = 3 , expected_slot_size_in_units = 2 )
170+ def wait_bsc_updated ():
171+ base_config = self .cluster .client .query_base_config ().BaseConfig
172+ logger .info (base_config .PDisk [1 ])
173+ assert base_config .PDisk [1 ].PDiskMetrics .SlotSizeInUnits == 2
174+ self .retriable (wait_bsc_updated )
175+
176+ def wait_pdisk_info_updated ():
177+ pdisk_info = self .get_pdisk_info ()
178+ logger .info (json .dumps (pdisk_info , indent = 2 ))
179+ self .check_pdisk (pdisk_info ['Whiteboard' ]['PDisk' ], expected_num_active_slots = 3 )
180+ self .check_pdisk (pdisk_info ['BSC' ]['PDisk' ], expected_num_active_slots = 3 , expected_slot_size_in_units = 2 )
181+ self .retriable (wait_pdisk_info_updated )
0 commit comments