Apply some protective measures to prevent the reconnection test failing when rogue RPC clients on the team city server connect. (#4413)

This commit is contained in:
Matthew Nesbit 2018-12-14 09:28:26 +00:00 committed by GitHub
parent 870058e72d
commit 767e37a34e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -49,7 +49,7 @@ class ProtonWrapperTests {
@JvmField @JvmField
val temporaryFolder = TemporaryFolder() val temporaryFolder = TemporaryFolder()
private val portAllocation = incrementalPortAllocation(10000) private val portAllocation = incrementalPortAllocation(15000) // use 15000 to move us out of harms way
private val serverPort = portAllocation.nextPort() private val serverPort = portAllocation.nextPort()
private val serverPort2 = portAllocation.nextPort() private val serverPort2 = portAllocation.nextPort()
private val artemisPort = portAllocation.nextPort() private val artemisPort = portAllocation.nextPort()
@ -207,9 +207,10 @@ class ProtonWrapperTests {
val amqpServer2 = createServer(serverPort2) val amqpServer2 = createServer(serverPort2)
val amqpClient = createClient() val amqpClient = createClient()
try { try {
val serverConnected = amqpServer.onConnection.toFuture() // The filter here is to prevent rogue RPC clients from messing us up
val serverConnected2 = amqpServer2.onConnection.toFuture() val serverConnected = amqpServer.onConnection.filter { it.remoteCert != null }.toFuture()
val clientConnected = amqpClient.onConnection.toBlocking().iterator val serverConnected2 = amqpServer2.onConnection.filter { it.remoteCert != null }.toFuture()
val clientConnected = amqpClient.onConnection.filter { it.remoteCert != null }.toBlocking().iterator
amqpServer.start() amqpServer.start()
amqpClient.start() amqpClient.start()
val serverConn1 = serverConnected.get() val serverConn1 = serverConnected.get()