Sega76 commented on a change in pull request #8575:
URL: https://github.com/apache/ignite/pull/8575#discussion_r549806368



##########
File path: modules/ducktests/tests/ignitetest/services/utils/control_utility.py
##########
@@ -127,6 +131,65 @@ def tx_kill(self, **kwargs):
         res = self.__parse_tx_list(output)
         return res if res else output
 
+    def validate_indexes(self):
+        """
+        Validate indexes.
+        """
+        data = self.__run("--cache validate_indexes")
+
+        assert ('no issues found.' in data), data
+
+    def idle_verify(self):
+        """
+        Idle verify.
+        """
+        data = self.__run("--cache idle_verify")
+
+        assert ('idle_verify check has finished, no conflicts have been 
found.' in data), data
+
+    def idle_verify_dump(self, node=None):
+        """
+        Idle verify dump.
+        """
+        data = self.__run("--cache idle_verify --dump", node=node)
+
+        assert ('VisorIdleVerifyDumpTask successfully' in data), data
+
+        return re.search(r'/.*.txt', data).group(0)
+
+    def snapshot_create(self, snapshot_name: str, sync_mode: bool = True, 
timeout_sec: int = 60):
+        """
+        Create snapshot.
+        """
+        res = self.__run(f"--snapshot create {snapshot_name}")
+
+        if ("Command [SNAPSHOT] finished with code: 0" in res) & sync_mode:
+            self.await_snapshot(snapshot_name, timeout_sec)
+
+    def await_snapshot(self, snapshot_name: str, timeout_sec=60):
+        """
+        Waiting for the snapshot to complete.
+        """
+        delta_time = datetime.now() + timedelta(seconds=timeout_sec)
+
+        while datetime.now() < delta_time:
+            for node in self._cluster.nodes:
+                mbean = JmxClient(node).find_mbean('snapshot')
+                start_time = int(list(mbean.LastSnapshotStartTime)[0])
+                end_time = int(list(mbean.LastSnapshotEndTime)[0])
+                err_msg = list(mbean.LastSnapshotErrorMessage)[0]
+                name = list(mbean.LastSnapshotName)[0]
+
+                if (snapshot_name == name) and (0 < start_time < end_time) and 
(err_msg == ''):

Review comment:
       1. you suggest removing 0 (start_time < end_time)
   2. if we take 2 snapshots in succession, we may will get an exception




----------------------------------------------------------------
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]


Reply via email to