mirror of
https://github.com/democratic-csi/democratic-csi.git
synced 2026-10-17 19:22:54 +02:00
further effort to make test runs more robust
Signed-off-by: Travis Glenn Hansen <travisghansen@yahoo.com>
This commit is contained in:
@@ -519,12 +519,12 @@ delete ${iscsiName}
|
||||
execClient.buildCommand(command, args),
|
||||
options
|
||||
);
|
||||
if (response.code != 0) {
|
||||
throw new Error(response);
|
||||
}
|
||||
driver.ctx.logger.verbose(
|
||||
"TargetCLI response: " + JSON.stringify(response)
|
||||
);
|
||||
if (response.code != 0) {
|
||||
throw response;
|
||||
}
|
||||
return response;
|
||||
}
|
||||
}
|
||||
|
||||
+4
-4
@@ -2203,7 +2203,7 @@ class CsiBaseDriver {
|
||||
result = await filesystem.pathExists(block_path);
|
||||
if (result) {
|
||||
result = await GeneralUtils.retry(
|
||||
10,
|
||||
30,
|
||||
0,
|
||||
async () => {
|
||||
return await filesystem.rm(block_path);
|
||||
@@ -2223,7 +2223,7 @@ class CsiBaseDriver {
|
||||
result = await filesystem.pathExists(staging_target_path);
|
||||
if (result) {
|
||||
result = await GeneralUtils.retry(
|
||||
10,
|
||||
30,
|
||||
0,
|
||||
async () => {
|
||||
return await filesystem.rmdir(staging_target_path);
|
||||
@@ -2865,7 +2865,7 @@ class CsiBaseDriver {
|
||||
if (result) {
|
||||
if (fs.lstatSync(target_path).isDirectory()) {
|
||||
result = await GeneralUtils.retry(
|
||||
10,
|
||||
30,
|
||||
0,
|
||||
async () => {
|
||||
return await filesystem.rmdir(target_path);
|
||||
@@ -2881,7 +2881,7 @@ class CsiBaseDriver {
|
||||
);
|
||||
} else {
|
||||
result = await GeneralUtils.retry(
|
||||
10,
|
||||
30,
|
||||
0,
|
||||
async () => {
|
||||
return await filesystem.rm([target_path]);
|
||||
|
||||
+16
-1
@@ -1,5 +1,6 @@
|
||||
const cp = require("child_process");
|
||||
const fs = require("fs");
|
||||
const GeneralUtils = require("./general");
|
||||
const path = require("path");
|
||||
|
||||
const DEFAULT_TIMEOUT = process.env.FILESYSTEM_DEFAULT_TIMEOUT || 30000;
|
||||
@@ -835,7 +836,21 @@ class Filesystem {
|
||||
async pathExists(path) {
|
||||
let result = false;
|
||||
try {
|
||||
fs.statSync(path);
|
||||
await GeneralUtils.retry(
|
||||
10,
|
||||
200,
|
||||
() => {
|
||||
fs.statSync(path);
|
||||
},
|
||||
{
|
||||
retryCondition: (err) => {
|
||||
if (err.code == "UNKNOWN") {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
},
|
||||
}
|
||||
);
|
||||
result = true;
|
||||
} catch (err) {
|
||||
if (err.code !== "ENOENT") {
|
||||
|
||||
Reference in New Issue
Block a user