mirror of
https://github.com/bitcoin-s/bitcoin-s.git
synced 2024-11-20 02:11:40 +01:00
Merge pull request #519 from rorp/kill_all_bitcoind_instances_after_running
[Tests] Kill all bitcoind instances after running
This commit is contained in:
commit
f525f5b53e
@ -170,7 +170,7 @@ class P2PRpcTest extends BitcoindRpcTest {
|
||||
it should "be able to get the connection count" in {
|
||||
for {
|
||||
(freshClient, otherFreshClient) <- BitcoindRpcTestUtil
|
||||
.createUnconnectedNodePair()
|
||||
.createUnconnectedNodePair(clientAccum = clientAccum)
|
||||
connectionPre <- freshClient.getConnectionCount
|
||||
_ <- freshClient.addNode(otherFreshClient.getDaemon.uri,
|
||||
AddNodeArgument.Add)
|
||||
|
@ -1,33 +1,28 @@
|
||||
package org.bitcoins.node.networking
|
||||
|
||||
import akka.actor.ActorSystem
|
||||
import akka.io.Tcp
|
||||
import akka.testkit.{TestActorRef, TestKit, TestProbe}
|
||||
import org.bitcoins.chain.config.ChainAppConfig
|
||||
import org.bitcoins.core.util.BitcoinSLogger
|
||||
import akka.testkit.{TestActorRef, TestProbe}
|
||||
import org.bitcoins.node.models.Peer
|
||||
import org.bitcoins.node.networking.peer.PeerMessageReceiver
|
||||
import org.bitcoins.node.networking.peer.PeerMessageReceiverState.Preconnection
|
||||
import org.bitcoins.testkit.BitcoinSAppConfig
|
||||
import org.bitcoins.testkit.async.TestAsyncUtil
|
||||
import org.bitcoins.testkit.node.NodeTestUtil
|
||||
import org.bitcoins.testkit.rpc.BitcoindRpcTestUtil
|
||||
import org.bitcoins.testkit.util.BitcoindRpcTest
|
||||
import org.scalatest._
|
||||
|
||||
import scala.concurrent.Future
|
||||
import scala.concurrent.duration.DurationInt
|
||||
import org.bitcoins.testkit.BitcoinSAppConfig
|
||||
|
||||
/**
|
||||
* Created by chris on 6/7/16.
|
||||
*/
|
||||
class ClientTest
|
||||
extends AsyncFlatSpec
|
||||
extends BitcoindRpcTest
|
||||
with MustMatchers
|
||||
with BeforeAndAfter
|
||||
with BeforeAndAfterAll
|
||||
with BitcoinSLogger {
|
||||
implicit val system = ActorSystem(
|
||||
s"Client-Test-System-${System.currentTimeMillis()}")
|
||||
with BeforeAndAfterAll {
|
||||
|
||||
implicit private val config: BitcoinSAppConfig =
|
||||
BitcoinSAppConfig.getTestConfig()
|
||||
@ -36,13 +31,13 @@ class ClientTest
|
||||
|
||||
implicit val np = config.chainConf.network
|
||||
|
||||
lazy val bitcoindRpcF = BitcoindRpcTestUtil.startedBitcoindRpcClient()
|
||||
lazy val bitcoindRpcF = BitcoindRpcTestUtil.startedBitcoindRpcClient(clientAccum = clientAccum)
|
||||
|
||||
lazy val bitcoindPeerF = bitcoindRpcF.map { bitcoind =>
|
||||
NodeTestUtil.getBitcoindPeer(bitcoind)
|
||||
}
|
||||
|
||||
lazy val bitcoindRpc2F = BitcoindRpcTestUtil.startedBitcoindRpcClient()
|
||||
lazy val bitcoindRpc2F = BitcoindRpcTestUtil.startedBitcoindRpcClient(clientAccum = clientAccum)
|
||||
|
||||
lazy val bitcoindPeer2F = bitcoindRpcF.map { bitcoind =>
|
||||
NodeTestUtil.getBitcoindPeer(bitcoind)
|
||||
@ -99,10 +94,4 @@ class ClientTest
|
||||
}
|
||||
}
|
||||
|
||||
override def afterAll: Unit = {
|
||||
bitcoindRpcF.flatMap(_.stop())
|
||||
bitcoindRpc2F.flatMap(_.stop())
|
||||
TestKit.shutdownActorSystem(system)
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user