diff --git a/operator-suite/src/main/java/io/brokerqe/claire/OperatorTestDataCollector.java b/operator-suite/src/main/java/io/brokerqe/claire/OperatorTestDataCollector.java index 6a94c06..65738d6 100644 --- a/operator-suite/src/main/java/io/brokerqe/claire/OperatorTestDataCollector.java +++ b/operator-suite/src/main/java/io/brokerqe/claire/OperatorTestDataCollector.java @@ -101,13 +101,18 @@ protected void collectTestData() { } private void collectResourceStats(String namespace, String dirName) { - LOGGER.debug("[{}] Gathering node/pod resources into files.", namespace); - String topNode = TestUtils.executeLocalCommand("oc adm top node"); - String namespacePod = TestUtils.executeLocalCommand("oc adm top pod -n " + namespace); - String nodeFileName = dirName + Constants.FILE_SEPARATOR + "stats_node.log"; - String podFileName = dirName + Constants.FILE_SEPARATOR + "stats_pod.log"; - TestUtils.createFile(nodeFileName, topNode); - TestUtils.createFile(podFileName, namespacePod); + try { + LOGGER.debug("[{}] Gathering node/pod resources into files.", namespace); + String topNode = TestUtils.executeLocalCommand("oc adm top node"); + String namespacePod = TestUtils.executeLocalCommand("oc adm top pod -n " + namespace); + String nodeFileName = dirName + Constants.FILE_SEPARATOR + "stats_node.log"; + String podFileName = dirName + Constants.FILE_SEPARATOR + "stats_pod.log"; + TestUtils.createFile(nodeFileName, topNode); + TestUtils.createFile(podFileName, namespacePod); + } catch (Exception e) { + LOGGER.warn("[{}] Not gathering node/pod resources into files: oc command returned error", namespace); + e.printStackTrace(); + } } private void collectBrokerPodFiles(List pods, String archiveLocation) {