From aa41120f6c17389e64bd83346e2de8ff1c125acc Mon Sep 17 00:00:00 2001 From: Viktor Kolomeyko Date: Wed, 18 Oct 2017 11:20:51 +0100 Subject: [PATCH] Disable unstable test on Windows (#1899) --- .../net/corda/test/node/NodeStatePersistenceTests.kt | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/node/src/integration-test/kotlin/net/corda/test/node/NodeStatePersistenceTests.kt b/node/src/integration-test/kotlin/net/corda/test/node/NodeStatePersistenceTests.kt index 5b4cd1276a..9a71e5c60f 100644 --- a/node/src/integration-test/kotlin/net/corda/test/node/NodeStatePersistenceTests.kt +++ b/node/src/integration-test/kotlin/net/corda/test/node/NodeStatePersistenceTests.kt @@ -25,17 +25,23 @@ import net.corda.testing.chooseIdentity import net.corda.testing.driver.DriverDSLExposedInterface import net.corda.testing.driver.NodeHandle import net.corda.testing.driver.driver +import org.junit.Assume import org.junit.Test import java.lang.management.ManagementFactory import javax.persistence.Column import javax.persistence.Entity import javax.persistence.Table import kotlin.test.assertEquals +import kotlin.test.assertNotNull class NodeStatePersistenceTests { @Test fun `persistent state survives node restart`() { + // Temporary disable this test when executed on Windows. It is known to be sporadically failing. + // More investigation is needed to establish why. + Assume.assumeFalse(System.getProperty("os.name").toLowerCase().startsWith("win")) + val user = User("mark", "dadada", setOf(FlowPermissions.startFlowPermission())) val message = Message("Hello world!") driver(isDebug = true, startNodesInProcess = isQuasarAgentSpecified()) { @@ -55,7 +61,9 @@ class NodeStatePersistenceTests { ensureAcquainted(notaryNodeHandle, nodeHandle) nodeHandle.rpcClientToNode().start(user.username, user.password).use { val page = it.proxy.vaultQuery(MessageState::class.java) - val retrievedMessage = page.states.singleOrNull()?.state?.data?.message + val stateAndRef = page.states.singleOrNull() + assertNotNull(stateAndRef) + val retrievedMessage = stateAndRef!!.state.data.message assertEquals(message, retrievedMessage) } }