Disable unstable test on Windows (#1899)

This commit is contained in:
Viktor Kolomeyko 2017-10-18 11:20:51 +01:00 committed by GitHub
parent c621c7d123
commit aa41120f6c

View File

@ -25,17 +25,23 @@ import net.corda.testing.chooseIdentity
import net.corda.testing.driver.DriverDSLExposedInterface import net.corda.testing.driver.DriverDSLExposedInterface
import net.corda.testing.driver.NodeHandle import net.corda.testing.driver.NodeHandle
import net.corda.testing.driver.driver import net.corda.testing.driver.driver
import org.junit.Assume
import org.junit.Test import org.junit.Test
import java.lang.management.ManagementFactory import java.lang.management.ManagementFactory
import javax.persistence.Column import javax.persistence.Column
import javax.persistence.Entity import javax.persistence.Entity
import javax.persistence.Table import javax.persistence.Table
import kotlin.test.assertEquals import kotlin.test.assertEquals
import kotlin.test.assertNotNull
class NodeStatePersistenceTests { class NodeStatePersistenceTests {
@Test @Test
fun `persistent state survives node restart`() { 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<SendMessageFlow>())) val user = User("mark", "dadada", setOf(FlowPermissions.startFlowPermission<SendMessageFlow>()))
val message = Message("Hello world!") val message = Message("Hello world!")
driver(isDebug = true, startNodesInProcess = isQuasarAgentSpecified()) { driver(isDebug = true, startNodesInProcess = isQuasarAgentSpecified()) {
@ -55,7 +61,9 @@ class NodeStatePersistenceTests {
ensureAcquainted(notaryNodeHandle, nodeHandle) ensureAcquainted(notaryNodeHandle, nodeHandle)
nodeHandle.rpcClientToNode().start(user.username, user.password).use { nodeHandle.rpcClientToNode().start(user.username, user.password).use {
val page = it.proxy.vaultQuery(MessageState::class.java) 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) assertEquals(message, retrievedMessage)
} }
} }