diff --git a/src/main/java/io/odh/test/platform/KubeUtils.java b/src/main/java/io/odh/test/platform/KubeUtils.java index 91bf53fe..e857c7ce 100644 --- a/src/main/java/io/odh/test/platform/KubeUtils.java +++ b/src/main/java/io/odh/test/platform/KubeUtils.java @@ -41,7 +41,7 @@ public static void clearOdhRemainingResources() { */ public static void deleteDefaultDSCI() { LOGGER.info("Clearing DSCI ..."); - ResourceManager.getKubeCmdClient().exec(false, "delete", "dsci", "--all"); + ResourceManager.getKubeCmdClient().exec(false, true, Long.valueOf(TestConstants.GLOBAL_TIMEOUT).intValue(), "delete", "dsci", "--all"); } public static void waitForInstallPlan(String namespace, String csvName) { diff --git a/src/main/java/io/odh/test/platform/cmdClient/BaseCmdKubeClient.java b/src/main/java/io/odh/test/platform/cmdClient/BaseCmdKubeClient.java index e9e4ede8..9dd9ee4b 100644 --- a/src/main/java/io/odh/test/platform/cmdClient/BaseCmdKubeClient.java +++ b/src/main/java/io/odh/test/platform/cmdClient/BaseCmdKubeClient.java @@ -265,6 +265,12 @@ public ExecResult exec(boolean throwError, boolean logToOutput, String... comman return Exec.exec(null, cmd, 0, logToOutput, throwError); } + @Override + public ExecResult exec(boolean throwError, boolean logToOutput, int timeout, String... command) { + List cmd = command(asList(command), false); + return Exec.exec(null, cmd, timeout, logToOutput, throwError); + } + @Override public ExecResult execInCurrentNamespace(String... commands) { return Exec.exec(namespacedCommand(commands)); diff --git a/src/main/java/io/odh/test/platform/cmdClient/KubeCmdClient.java b/src/main/java/io/odh/test/platform/cmdClient/KubeCmdClient.java index ec21cbcc..6cc552e9 100644 --- a/src/main/java/io/odh/test/platform/cmdClient/KubeCmdClient.java +++ b/src/main/java/io/odh/test/platform/cmdClient/KubeCmdClient.java @@ -144,6 +144,17 @@ default K delete(String... files) { */ ExecResult exec(boolean throwError, boolean logToOutput, String... command); + /** + * Execute the given {@code command}. You can specify if potential failure will thrown the exception or not. + * + * @param throwError parameter which control thrown exception in case of failure + * @param command The command + * @param timeout tiemout in ms + * @param logToOutput determines if we want to print whole output of command + * @return The process result. + */ + ExecResult exec(boolean throwError, boolean logToOutput, int timeout, String... command); + /** * Get the content of the given {@code resource} with the given {@code name} as YAML. *