mirror of
https://github.com/corda/corda.git
synced 2025-02-14 14:42:32 +00:00
Fix flaky integration test
Reenable broken smokeTest so I can investigate Testing testing Testing testing remove debug
This commit is contained in:
parent
ae48e6e4fb
commit
ebe6d5060e
@ -28,7 +28,10 @@ import net.corda.testing.internal.rigorousMock
|
|||||||
import org.apache.activemq.artemis.api.core.RoutingType
|
import org.apache.activemq.artemis.api.core.RoutingType
|
||||||
import org.apache.activemq.artemis.api.core.SimpleString
|
import org.apache.activemq.artemis.api.core.SimpleString
|
||||||
import org.apache.curator.test.TestingServer
|
import org.apache.curator.test.TestingServer
|
||||||
import org.junit.*
|
import org.junit.After
|
||||||
|
import org.junit.Before
|
||||||
|
import org.junit.Rule
|
||||||
|
import org.junit.Test
|
||||||
import org.junit.rules.TemporaryFolder
|
import org.junit.rules.TemporaryFolder
|
||||||
import java.net.Socket
|
import java.net.Socket
|
||||||
import java.nio.file.Path
|
import java.nio.file.Path
|
||||||
@ -39,7 +42,6 @@ import java.util.concurrent.Executors
|
|||||||
import java.util.concurrent.TimeUnit
|
import java.util.concurrent.TimeUnit
|
||||||
import kotlin.streams.toList
|
import kotlin.streams.toList
|
||||||
|
|
||||||
@Ignore
|
|
||||||
class BridgeSmokeTest {
|
class BridgeSmokeTest {
|
||||||
companion object {
|
companion object {
|
||||||
val log = contextLogger()
|
val log = contextLogger()
|
||||||
@ -89,7 +91,6 @@ class BridgeSmokeTest {
|
|||||||
artemisClient.stop()
|
artemisClient.stop()
|
||||||
artemisServer.stop()
|
artemisServer.stop()
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun copyBridgeResource(resourceName: String) {
|
private fun copyBridgeResource(resourceName: String) {
|
||||||
@ -184,7 +185,7 @@ class BridgeSmokeTest {
|
|||||||
throw e
|
throw e
|
||||||
} finally {
|
} finally {
|
||||||
executor.shutdownNow()
|
executor.shutdownNow()
|
||||||
process.destroyForcibly()
|
process.destroy()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -274,6 +274,8 @@ class BridgeIntegrationTest {
|
|||||||
val (artemisServer, artemisClient) = createArtemis()
|
val (artemisServer, artemisClient) = createArtemis()
|
||||||
val (artemisServer2, artemisClient2) = createArtemis2()
|
val (artemisServer2, artemisClient2) = createArtemis2()
|
||||||
try {
|
try {
|
||||||
|
artemisServer2.start()
|
||||||
|
artemisClient2.start()
|
||||||
installBridgeControlResponder(artemisClient)
|
installBridgeControlResponder(artemisClient)
|
||||||
installBridgeControlResponder(artemisClient2)
|
installBridgeControlResponder(artemisClient2)
|
||||||
val bridge = BridgeInstance(config, BridgeVersionInfo(1, "1.1", "Dummy", "Test"))
|
val bridge = BridgeInstance(config, BridgeVersionInfo(1, "1.1", "Dummy", "Test"))
|
||||||
@ -323,7 +325,6 @@ class BridgeIntegrationTest {
|
|||||||
val (artemisServer2, artemisClient2) = createArtemis2()
|
val (artemisServer2, artemisClient2) = createArtemis2()
|
||||||
try {
|
try {
|
||||||
installBridgeControlResponder(artemisClient)
|
installBridgeControlResponder(artemisClient)
|
||||||
installBridgeControlResponder(artemisClient2)
|
|
||||||
val bridge = BridgeInstance(bridgeConfig, BridgeVersionInfo(1, "1.1", "Dummy", "Test"))
|
val bridge = BridgeInstance(bridgeConfig, BridgeVersionInfo(1, "1.1", "Dummy", "Test"))
|
||||||
val bridgeStateFollower = bridge.activeChange.toBlocking().iterator
|
val bridgeStateFollower = bridge.activeChange.toBlocking().iterator
|
||||||
val float = BridgeInstance(floatConfig, BridgeVersionInfo(1, "1.1", "Dummy", "Test"))
|
val float = BridgeInstance(floatConfig, BridgeVersionInfo(1, "1.1", "Dummy", "Test"))
|
||||||
@ -344,7 +345,17 @@ class BridgeIntegrationTest {
|
|||||||
assertEquals(false, bridgeStateFollower.next())
|
assertEquals(false, bridgeStateFollower.next())
|
||||||
assertEquals(false, bridge.active)
|
assertEquals(false, bridge.active)
|
||||||
assertEquals(true, float.active)
|
assertEquals(true, float.active)
|
||||||
assertEquals(false, serverListening("localhost", 10005)) // now activated
|
var timeout = 0
|
||||||
|
var listeningState = serverListening("localhost", 10005)
|
||||||
|
while (listeningState && timeout < 10) { // Allow a short while for close down to propagate
|
||||||
|
++timeout
|
||||||
|
Thread.sleep(1000L)
|
||||||
|
listeningState = serverListening("localhost", 10005)
|
||||||
|
}
|
||||||
|
assertEquals(false, listeningState) // now not activated
|
||||||
|
artemisServer2.start() // Now enable second artemis to failover to
|
||||||
|
artemisClient2.start()
|
||||||
|
installBridgeControlResponder(artemisClient2)
|
||||||
assertEquals(true, bridgeStateFollower.next())
|
assertEquals(true, bridgeStateFollower.next())
|
||||||
assertEquals(true, bridge.active)
|
assertEquals(true, bridge.active)
|
||||||
assertEquals(true, float.active)
|
assertEquals(true, float.active)
|
||||||
@ -403,8 +414,6 @@ class BridgeIntegrationTest {
|
|||||||
}
|
}
|
||||||
val artemisServer = ArtemisMessagingServer(artemisConfig, NetworkHostAndPort("0.0.0.0", 12005), MAX_MESSAGE_SIZE)
|
val artemisServer = ArtemisMessagingServer(artemisConfig, NetworkHostAndPort("0.0.0.0", 12005), MAX_MESSAGE_SIZE)
|
||||||
val artemisClient = ArtemisMessagingClient(artemisConfig, NetworkHostAndPort("localhost", 12005), MAX_MESSAGE_SIZE)
|
val artemisClient = ArtemisMessagingClient(artemisConfig, NetworkHostAndPort("localhost", 12005), MAX_MESSAGE_SIZE)
|
||||||
artemisServer.start()
|
|
||||||
artemisClient.start()
|
|
||||||
return Pair(artemisServer, artemisClient)
|
return Pair(artemisServer, artemisClient)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user