CORDA-649: Second attempt to make PersistentNetworkMapCacheTest more stable (#1738)

This commit is contained in:
Viktor Kolomeyko
2017-10-02 10:50:39 +01:00
committed by GitHub
parent f961412396
commit 33e8105a29
4 changed files with 29 additions and 8 deletions

View File

@ -1,8 +1,6 @@
package net.corda.node.services.network
import co.paralleluniverse.fibers.Suspendable
import io.kotlintest.eventually
import io.kotlintest.milliseconds
import net.corda.core.flows.FlowLogic
import net.corda.core.flows.FlowSession
import net.corda.core.flows.InitiatedBy
@ -17,8 +15,8 @@ import net.corda.testing.*
import net.corda.testing.node.NodeBasedTest
import org.assertj.core.api.Assertions.assertThat
import org.junit.Before
import org.junit.Ignore
import org.junit.Test
import java.time.Duration
import kotlin.test.assertEquals
import kotlin.test.assertFails
import kotlin.test.assertTrue
@ -114,7 +112,6 @@ class PersistentNetworkMapCacheTest : NodeBasedTest() {
assertFails { startNode(CHARLIE.name, noNetworkMap = true).getOrThrow(2.seconds) }
}
@Ignore("Unstable test that needs more work")
@Test
fun `new node joins network without network map started`() {
@ -146,9 +143,11 @@ class PersistentNetworkMapCacheTest : NodeBasedTest() {
// This is prediction of the longest time it will take to get the cluster into a stable state such that further
// testing can be performed upon it
val maxInstabilityInterval = BRIDGE_RETRY_MS * allTheStartedNodesPopulation.size * 2
val maxInstabilityInterval = BRIDGE_RETRY_MS * allTheStartedNodesPopulation.size * 30
logger.info("Instability interval is set to: $maxInstabilityInterval ms")
eventually(maxInstabilityInterval.milliseconds) {
// TODO: Re-visit this sort of re-try for stable cluster once network map redesign is finished.
eventually<AssertionError, Unit>(Duration.ofMillis(maxInstabilityInterval)) {
logger.info("Checking connectivity")
checkConnectivity(listOf(otherNodes[0], nms)) // Checks connectivity from A to NMS.
logger.info("Loading caches")