diff --git a/node/src/main/kotlin/net/corda/node/services/statemachine/SingleThreadedStateMachineManager.kt b/node/src/main/kotlin/net/corda/node/services/statemachine/SingleThreadedStateMachineManager.kt index 8b06ef135c..d905333e17 100644 --- a/node/src/main/kotlin/net/corda/node/services/statemachine/SingleThreadedStateMachineManager.kt +++ b/node/src/main/kotlin/net/corda/node/services/statemachine/SingleThreadedStateMachineManager.kt @@ -3,7 +3,7 @@ package net.corda.node.services.statemachine import co.paralleluniverse.fibers.Fiber import co.paralleluniverse.fibers.FiberExecutorScheduler import co.paralleluniverse.fibers.Suspendable -import co.paralleluniverse.fibers.instrument.SuspendableHelper +import co.paralleluniverse.fibers.instrument.JavaAgent import co.paralleluniverse.strands.channels.Channels import com.codahale.metrics.Gauge import net.corda.core.concurrent.CordaFuture @@ -307,7 +307,7 @@ class SingleThreadedStateMachineManager( } private fun checkQuasarJavaAgentPresence() { - check(SuspendableHelper.isJavaAgentActive()) { + check(JavaAgent.isActive()) { """Missing the '-javaagent' JVM argument. Make sure you run the tests with the Quasar java agent attached to your JVM. #See https://docs.corda.net/head/testing.html#running-tests-in-intellij - 'Fiber classes not instrumented' for more details.""".trimMargin("#") } diff --git a/testing/node-driver/src/main/kotlin/net/corda/testing/node/internal/DriverDSLImpl.kt b/testing/node-driver/src/main/kotlin/net/corda/testing/node/internal/DriverDSLImpl.kt index b7dcaa6d12..2e8971862c 100644 --- a/testing/node-driver/src/main/kotlin/net/corda/testing/node/internal/DriverDSLImpl.kt +++ b/testing/node-driver/src/main/kotlin/net/corda/testing/node/internal/DriverDSLImpl.kt @@ -1,5 +1,6 @@ package net.corda.testing.node.internal +import co.paralleluniverse.fibers.instrument.JavaAgent import com.google.common.util.concurrent.ThreadFactoryBuilder import com.typesafe.config.Config import com.typesafe.config.ConfigFactory @@ -54,7 +55,6 @@ import okhttp3.Request import rx.Subscription import rx.schedulers.Schedulers import java.io.File -import java.lang.management.ManagementFactory import java.net.ConnectException import java.net.URL import java.net.URLClassLoader @@ -708,7 +708,7 @@ class DriverDSLImpl( val effectiveP2PAddress = config.corda.messagingServerAddress ?: config.corda.p2pAddress return executorService.fork { log.info("Starting in-process Node ${config.corda.myLegalName.organisation}") - if (!(ManagementFactory.getRuntimeMXBean().inputArguments.any { it.contains("quasar") })) { + if (!JavaAgent.isActive()) { throw IllegalStateException("No quasar agent: -javaagent:lib/quasar.jar and working directory project root might fix") } // Write node.conf