Sega76 commented on a change in pull request #8294:
URL: https://github.com/apache/ignite/pull/8294#discussion_r513530050
##########
File path: modules/ducktests/tests/ignitetest/services/utils/control_utility.py
##########
@@ -127,6 +132,106 @@ def tx_kill(self, **kwargs):
res = self.__parse_tx_list(output)
return res if res else output
+ def validate_indexes(self, check_assert: bool = None):
+ """
+ Validate indexes.
+ If check is true, will be return
+ """
+ data = self.__run("--cache validate_indexes")
+
+ if check_assert is not None:
+ assert (('no issues found.' in data) == check_assert), data
+
+ return data
+
+ def idle_verify(self, check_assert: bool = None):
+ """
+ Idle verify.
+ """
+ data = self.__run("--cache idle_verify")
+
+ if check_assert is not None:
+ assert (('idle_verify check has finished, no conflicts have been
found.' in data) == check_assert), data
+
+ return data
+
+ def idle_verify_dump(self, node=None, return_path: bool = False):
+ """
+ Idle verify dump.
+ """
+ data = self.__run("--cache idle_verify --dump", node=node)
+
+ if return_path & ('VisorIdleVerifyDumpTask successfully' in data):
+ match = re.search(r'/.*.txt', data)
+ return match[0]
+
+ return data
+
+ def snapshot_create(self, snapshot_name: str, sync_mode: bool = True,
time_out: int = 60):
+ """
+ Create snapshot.
+ """
+ res = self.__run(f"--snapshot create {snapshot_name}")
+
+ self.logger.info(res)
+
+ if ("Command [SNAPSHOT] finished with code: 0" in res) & sync_mode:
+ self.await_snapshot(snapshot_name=snapshot_name, time_out=time_out)
+
+ return res
+
+ def snapshot_cancel(self, snapshot_name: str):
+ """
+ Cancel snapshot.
+ """
+ return self.__run(f"--snapshot cancel {snapshot_name}")
+
+ def snapshot_kill(self, snapshot_name: str):
+ """
+ Kill snapshot.
+ """
+ return self.__run(f"--kill SNAPSHOT {snapshot_name}")
+
+ def await_snapshot(self, snapshot_name: str, time_out=60):
+ """
+ Waiting for the snapshot to complete.
+ """
+ delta_time = datetime.now() + timedelta(seconds=time_out)
+
+ while datetime.now() < delta_time:
+ for node in self._cluster.nodes:
+ mbean = JmxClient(node).find_mbean('snapshot')
+ start_time =
int(list(mbean.__getattr__('LastSnapshotStartTime'))[0])
+ end_time =
int(list(mbean.__getattr__('LastSnapshotEndTime'))[0])
+ err_msg =
list(mbean.__getattr__('LastSnapshotErrorMessage'))[0]
+
+ self.logger.debug(f'Hostname={node.account.hostname}, '
+ f'LastSnapshotStartTime={start_time}, '
+ f'LastSnapshotEndTime={end_time}, '
+ f'LastSnapshotErrorMessage={err_msg}'
+ )
+
+ if (0 < start_time < end_time) & (err_msg == ''):
+ self.print_snapshot_size(snapshot_name)
+ return
+
+ time.sleep(1)
+
+ raise TimeoutError(f'LastSnapshotStartTime={start_time}, '
+ f'LastSnapshotEndTime={end_time}, '
+ f'LastSnapshotErrorMessage={err_msg}')
+
+ def print_snapshot_size(self, snapshot_name: str):
Review comment:
fixed
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]