skorotkov commented on code in PR #10624:
URL: https://github.com/apache/ignite/pull/10624#discussion_r1160436158


##########
modules/ducktests/tests/ignitetest/services/utils/control_utility.py:
##########
@@ -220,6 +220,96 @@ def snapshot_create(self, snapshot_name: str, timeout_sec: 
int = 60):
         raise TimeoutError(f'Failed to wait for the snapshot operation to 
complete: '
                            f'snapshot_name={snapshot_name} in {timeout_sec} 
seconds.')
 
+    def incremental_snapshot_create(self, snapshot_name: str, exp_increment: 
int, timeout_sec: int = 60):
+        """
+        Create snapshot.
+        :param snapshot_name: Name of Snapshot.
+        :param exp_increment: Expected increment index.
+        :param timeout_sec: Timeout to await snapshot to complete.
+        """
+        node = self._cluster.nodes[0]
+
+        res = self.__run(f"--snapshot create {snapshot_name} --incremental", 
node)
+
+        assert "Command [SNAPSHOT] finished with code: 0" in res
+
+        delta_time = datetime.now() + timedelta(seconds=timeout_sec)
+
+        while datetime.now() < delta_time:
+            res = self.__run("--snapshot status")
+
+            if "Create snapshot operation is in progress" in res:
+                continue
+
+            if "There is no create or restore snapshot operation in progress" 
in res:
+                metric_bean = JmxClient(node).find_mbean('.*name=incremental')
+
+                if exp_increment != int(next(metric_bean.incrementIndex, "")):

Review Comment:
   Not sure here. What is the intendent behaviour if *next()* would return ""?



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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to