timoninmaxim commented on code in PR #10624:
URL: https://github.com/apache/ignite/pull/10624#discussion_r1160818342
##########
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, "")):
+ continue
+
+ assert next(metric_bean.error) == ''
+
+ return
+
+ raise Exception("Unexpected status for \"snapshot status\"
command: " + res)
+
+ raise TimeoutError(f'Failed to wait for the snapshot operation to
complete: '
+ f'snapshot_name={snapshot_name},
increment={exp_increment} in {timeout_sec} seconds.')
+
+ def destroy_all_caches(self):
Review Comment:
Agree with redesigning a method to `destroy_caches(destroy_all: bool)`. But
I don't need a functionality of destroying specific caches. Somebody who will
need it can implement this later.
--
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]