8000 add code to use the --loopEternal to the hotbackup restore tests (#21… · solisoft/arangodb@aafe0d1 · GitHub < 8000 meta name="theme-color" content="#1e2327">
[go: up one dir, main page]

Skip to content

Commit aafe0d1

Browse files
authored
add code to use the --loopEternal to the hotbackup restore tests (arangodb#21700)
1 parent 176b5a0 commit aafe0d1

File tree

1 file changed

+30
-26
lines changed
  • js/client/modules/@arangodb/testsuites

1 file changed

+30
-26
lines changed

js/client/modules/@arangodb/testsuites/dump.js

Lines changed: 30 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -587,34 +587,38 @@ class DumpRestoreHelper extends trs.runLocalInArangoshRunner {
587587
}
588588

589589
restoreHotBackup() {
590-
this.print("restoring backup - start");
591-
db._useDatabase('_system');
592-
let list = this.listHotBackup();
593-
let backupName;
594-
Object.keys(list).forEach(function (name, i) {
595-
if (name.search("testHotBackup") !== -1) {
596-
backupName = name;
590+
let first = true;
591+
while (first || this.options.loopEternal) {
592+
this.print("restoring backup - start");
593+
first = false;
594+
db._useDatabase('_system');
595+
let list = this.listHotBackup();
596+
let backupName;
597+
Object.keys(list).forEach(function (name, i) {
598+
if (name.search("testHotBackup") !== -1) {
599+
backupName = name;
600+
}
601+
});
602+
if (backupName === undefined) {
603+
this.print("didn't find a backup matching our pattern!");
604+
this.results.restoreHotBackup = { status: false };
605+
return false;
597606
}
598-
});
599-
if (backupName === undefined) {
600-
this.print("didn't find a backup matching our pattern!");
601-
this.results.restoreHotBackup = { status: false };
602-
return false;
603-
}
604-
if (!list[backupName].hasOwnProperty("keys") ||
605-
list[backupName].keys[0].sha256 !== encryptionKeySha256) {
606-
this.print("didn't find a backup having correct encryption keys!");
607-
this.print(JSON.stringify(list));
608-
this.results.restoreHotBackup = { status: false };
609-
return false;
607+
if (!list[backupName].hasOwnProperty("keys") ||
608+
list[backupName].keys[0].sha256 !== encryptionKeySha256) {
609+
this.print("didn't find a backup having correct encryption keys!");
610+
this.print(JSON.stringify(list));
611+
this.results.restoreHotBackup = { status: false };
612+
return false;
613+
}
614+
this.print("restoring backup");
615+
let cmds = {
616+
"identifier": backupName,
617+
"max-wait-for-restart": 100.0
618+
};
619+
this.results.restoreHotBackup = ct.run.arangoBackup(this.firstRunOptions, this.instanceManager, "restore", cmds, this.instanceManager.rootDir, true);
620+
this.print("done restoring backup");
610621
}
611-
this.print("restoring backup");
612-
let cmds = {
613-
"identifier": backupName,
614-
"max-wait-for-restart": 100.0
615-
};
616-
this.results.restoreHotBackup = ct.run.arangoBackup(this.firstRunOptions, this.instanceManager, "restore", cmds, this.instanceManager.rootDir, true);
617-
this.print("done restoring backup");
618622
return true;
619623
}
620624

0 commit comments

Comments
 (0)
0