From 59dd19c9f62b56afebd2368a82f0b0dfa3fe7f02 Mon Sep 17 00:00:00 2001 From: manosbatsis Date: Mon, 4 Sep 2023 13:36:32 +0300 Subject: [PATCH] feat: improve worker restart --- gradle.properties | 2 +- .../junit5/nodehandles/NodeHandlesHelper.kt | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/gradle.properties b/gradle.properties index ff4eb48..1064354 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,5 +1,5 @@ group=com.github.manosbatsis.corda5.testutils -version=1.0.1-SNAPSHOT +version=1.0.2-SNAPSHOT vendorName=Manos Batsis kotlin.code.style=official diff --git a/integration-junit5/src/main/kotlin/com/github/manosbatsis/corda5/testutils/integration/junit5/nodehandles/NodeHandlesHelper.kt b/integration-junit5/src/main/kotlin/com/github/manosbatsis/corda5/testutils/integration/junit5/nodehandles/NodeHandlesHelper.kt index f524361..2e3b836 100644 --- a/integration-junit5/src/main/kotlin/com/github/manosbatsis/corda5/testutils/integration/junit5/nodehandles/NodeHandlesHelper.kt +++ b/integration-junit5/src/main/kotlin/com/github/manosbatsis/corda5/testutils/integration/junit5/nodehandles/NodeHandlesHelper.kt @@ -55,9 +55,13 @@ class NodeHandlesHelper( private fun buildNodeHandles(): NodeHandles { var nodesResponse: MutableList? = virtualNodeInfos(::nodesNullResponseCheck) { - // Force a (re)start even with a forgotten pid present - try { gradle.executeTaskAndWait("stopCorda") } catch (e: Exception) { /* NO-OP */ } - gradle.executeTask("startCorda") + try { + gradle.executeTask("startCorda") + } catch (e: Exception) { + // Force a (re)start even with a forgotten pid present + gradle.executeTaskAndWait("stopCorda") + gradle.executeTask("startCorda") + } } logger.info("Combined worker started, node list, size: ${nodesResponse!!.size}")