Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make tests run in parallel #1112

Merged
merged 64 commits into from
Sep 11, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
5b5f1f1
removed globals for feerates
pm47 Aug 28, 2019
edf53ec
removed global variable for blockcount
pm47 Aug 28, 2019
e6edcc0
Update OpenChannelController.scala
pm47 Aug 28, 2019
3e9e2ee
Update CltvExpirySpec.scala
pm47 Aug 28, 2019
115c081
enable parallelization of tests
pm47 Aug 28, 2019
4d6fa6c
Disable scoverage
pm47 Aug 28, 2019
01d5b9e
made bitcoind/electrumx tests run in parallel
pm47 Aug 29, 2019
4fef019
removed debug comments
pm47 Aug 29, 2019
77a62b2
add `NodeParams.currentBlockHeight` method
pm47 Aug 29, 2019
2154d98
remove unnecessary changes to `sendAdd`
pm47 Aug 29, 2019
c32a0d1
try giving more memory for compile/test
pm47 Aug 29, 2019
11c61fb
Funding fee UI input now fetches fees from node params
dpad85 Aug 29, 2019
c12778d
Revert "Disable scoverage"
pm47 Aug 29, 2019
88fe60d
more parallel tests
pm47 Aug 30, 2019
427f4e7
removed useless code
pm47 Aug 30, 2019
de6a4bf
Merge branch 'master' into parallel-tests
pm47 Aug 30, 2019
5ef9a6d
adjusted timeouts and fixed test
pm47 Aug 30, 2019
df95ffc
longer timeouts
pm47 Aug 30, 2019
5f99f7b
even larger timeouts
pm47 Aug 30, 2019
e13cc05
rewrite fuzzy checks
pm47 Aug 30, 2019
3dea43d
try increasing file limit on travis
pm47 Aug 30, 2019
e8812dd
added sudo
pm47 Aug 30, 2019
db98ea7
set ulimit in a shell
pm47 Aug 30, 2019
fb6b773
reverted to more reasonable timeouts
pm47 Aug 30, 2019
594b33a
removed println's
pm47 Aug 30, 2019
bef43b6
Revert "reverted to more reasonable timeouts"
pm47 Aug 30, 2019
f7c68c3
cosmetic change
pm47 Aug 30, 2019
9ba6ddb
cleaner way of getting `currentBlockHeight`
pm47 Aug 30, 2019
b504312
final (?) fix to fuzzy test
pm47 Aug 30, 2019
2260356
Merge branch 'master' into parallel-tests
pm47 Aug 30, 2019
1971b2f
more printlns
pm47 Aug 30, 2019
e66980e
this time it's fixed
pm47 Aug 30, 2019
2cdd34a
Revert "more printlns"
pm47 Aug 30, 2019
8d5b04c
more timeouts
pm47 Aug 31, 2019
b4f8c75
Revert "more parallel tests"
pm47 Aug 31, 2019
77b131e
Revert "Revert "more parallel tests""
pm47 Sep 2, 2019
ea2e74b
temporarily disable RoutingSyncSpec
pm47 Sep 2, 2019
87789a6
Merge branch 'master' into parallel-tests
pm47 Sep 2, 2019
fdd0e3b
fixed build
pm47 Sep 2, 2019
564a05d
proper initialization of bitcoind in tests
pm47 Sep 2, 2019
81f9286
Revert "temporarily disable RoutingSyncSpec"
pm47 Sep 2, 2019
64ddb53
disable parallel testing in travis
pm47 Sep 3, 2019
88dea06
Merge branch 'master' into parallel-tests
pm47 Sep 3, 2019
0253456
only generate nodes for 100 channels
pm47 Sep 4, 2019
5f349ac
Merge branch 'master' into parallel-tests
pm47 Sep 4, 2019
f7b105f
re-enabled parallel testing on travis
pm47 Sep 4, 2019
ad47309
increased akka.test.timefactor
pm47 Sep 4, 2019
8d9eb5f
Revert "only generate nodes for 100 channels"
pm47 Sep 4, 2019
18a2c98
made sync params configurable
pm47 Sep 4, 2019
d607962
Revert "re-enabled parallel testing on travis"
pm47 Sep 4, 2019
2ed5c52
fixed test condition in fuzzy spec
pm47 Sep 5, 2019
c888b5a
Merge branch 'master' into parallel-tests
pm47 Sep 5, 2019
d8171aa
revert to previous memory settings
pm47 Sep 5, 2019
394d7ba
removed ParallelTestExecution annotation
pm47 Sep 5, 2019
1b99758
Merge branch 'master' into parallel-tests
pm47 Sep 5, 2019
3443750
increased timefactor back to 10
pm47 Sep 5, 2019
10fcac0
Merge branch 'master' into parallel-tests
pm47 Sep 5, 2019
a25fc89
put back parallel tests (now that we are on semaphore ci)
pm47 Sep 5, 2019
5ee98a6
enabled logs
pm47 Sep 5, 2019
2985fb7
re-enabled parallel build on travis
pm47 Sep 5, 2019
b778fd7
tentatively cache docker image dir
pm47 Sep 5, 2019
5f76fa5
Revert "tentatively cache docker image dir"
pm47 Sep 5, 2019
e147a67
Merge branch 'master' into parallel-tests
pm47 Sep 11, 2019
8138f30
consistent naming for test actor systems
pm47 Sep 11, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion eclair-core/src/test/resources/application.conf
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ akka {
test {
# factor by which to scale timeouts during tests, e.g. to account for shared
# build system load
timefactor = 3.0
timefactor = 5.0
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@

package fr.acinq.eclair

import org.scalatest.FunSuite
import org.scalatest.{FunSuite, ParallelTestExecution}

/**
* Created by t-bast on 21/08/2019.
*/

class CltvExpirySpec extends FunSuite {
class CltvExpirySpec extends FunSuite with ParallelTestExecution {

test("cltv expiry delta") {
val d = CltvExpiryDelta(561)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
package fr.acinq.eclair

import fr.acinq.bitcoin.{Btc, MilliBtc, Satoshi}
import org.scalatest.FunSuite
import org.scalatest.{FunSuite, ParallelTestExecution}

class CoinUtilsSpec extends FunSuite {
class CoinUtilsSpec extends FunSuite with ParallelTestExecution {

test("Convert string amount to the correct BtcAmount") {
val am_btc: MilliSatoshi = CoinUtils.convertStringAmountToMsat("1", BtcUnit.code)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,14 @@ import fr.acinq.eclair.payment.PaymentRequest.ExtraHop
import fr.acinq.eclair.payment.{LocalPaymentHandler, PaymentRequest}
import fr.acinq.eclair.router.RouteCalculationSpec.makeUpdate
import org.mockito.scalatest.IdiomaticMockito
import org.scalatest.{Outcome, fixture}
import org.scalatest.{Outcome, ParallelTestExecution, fixture}
import scodec.bits._

import scala.concurrent.Await
import scala.concurrent.duration._
import scala.util.Success

class EclairImplSpec extends TestKit(ActorSystem("mySystem")) with fixture.FunSuiteLike with IdiomaticMockito {
class EclairImplSpec extends TestKit(ActorSystem("test")) with fixture.FunSuiteLike with IdiomaticMockito with ParallelTestExecution {

implicit val timeout: Timeout = Timeout(30 seconds)

Expand Down
1 change: 0 additions & 1 deletion eclair-core/src/test/scala/fr/acinq/eclair/TestUtils.scala
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ object TestUtils {
.get("buildDirectory") // this is defined if we run from maven
.getOrElse(new File(sys.props("user.dir"), "target").getAbsolutePath) // otherwise we probably are in intellij, so we build it manually assuming that user.dir == path to the module


def availablePort: Int = synchronized {
var serverSocket: ServerSocket = null
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class BitgoFeeProviderSpec extends FunSuite {

test("make sure API hasn't changed") {
import scala.concurrent.duration._
implicit val system = ActorSystem()
implicit val system = ActorSystem("test")
implicit val ec = system.dispatcher
implicit val sttp = OkHttpFutureBackend()
implicit val timeout = Timeout(30 seconds)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ import scala.util.Random

class ThroughputSpec extends FunSuite {
ignore("throughput") {
implicit val system = ActorSystem()
implicit val system = ActorSystem("test")
val pipe = system.actorOf(Props[Pipe], "pipe")
val blockCount = new AtomicLong()
val blockchain = system.actorOf(ZmqWatcher.props(blockCount, new TestBitcoinClient()), "blockchain")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,12 @@ import fr.acinq.eclair.router.Hop
import fr.acinq.eclair.wire.Onion.FinalLegacyPayload
import fr.acinq.eclair.wire._
import fr.acinq.eclair.{NodeParams, TestConstants, randomBytes32, _}
import org.scalatest.{ParallelTestExecution, fixture}

/**
* Created by PM on 23/08/2016.
*/
trait StateTestsHelperMethods extends TestKitBase {
trait StateTestsHelperMethods extends TestKitBase with fixture.TestSuite with ParallelTestExecution {

case class SetupFixture(alice: TestFSMRef[State, Data, Channel],
bob: TestFSMRef[State, Data, Channel],
Expand Down Expand Up @@ -173,6 +174,7 @@ trait StateTestsHelperMethods extends TestKitBase {

def channelId(a: TestFSMRef[State, Data, Channel]) = Helpers.getChannelId(a.stateData)


implicit class ChannelWithTestFeeConf(a: TestFSMRef[State, Data, Channel]) {
def feeEstimator: TestFeeEstimator = a.underlyingActor.nodeParams.onChainFeeConf.feeEstimator.asInstanceOf[TestFeeEstimator]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import scodec.bits.{ByteVector, _}
* Created by fabrice on 12/12/16.
*/
object NoiseDemo extends App {
implicit val system = ActorSystem("mySystem")
implicit val system = ActorSystem("test")

class NoiseHandler(keyPair: KeyPair, rs: Option[ByteVector], them: ActorRef, isWriter: Boolean, listenerFactory: => ActorRef) extends Actor with Stash {
// initiator must know pubkey (i.e long-term ID) of responder
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class AnnouncementsBatchValidationSpec extends FunSuite {
ignore("validate a batch of announcements") {
import scala.concurrent.ExecutionContext.Implicits.global

implicit val system = ActorSystem()
implicit val system = ActorSystem("test")
implicit val sttpBackend = OkHttpFutureBackend()
implicit val extendedBitcoinClient = new ExtendedBitcoinClient(new BasicBitcoinJsonRPCClient(user = "foo", password = "bar", host = "localhost", port = 18332))

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import fr.acinq.eclair.router.Graph.{RichWeight, WeightRatios}
import fr.acinq.eclair.transactions.Transactions
import fr.acinq.eclair.wire._
import fr.acinq.eclair.{CltvExpiryDelta, LongToBtcAmount, MilliSatoshi, ShortChannelId, ToMilliSatoshiConversion, randomKey}
import org.scalatest.FunSuite
import org.scalatest.{FunSuite, ParallelTestExecution}
import scodec.bits._

import scala.collection.immutable.SortedMap
Expand All @@ -35,7 +35,7 @@ import scala.util.{Failure, Success}
* Created by PM on 31/05/2016.
*/

class RouteCalculationSpec extends FunSuite {
class RouteCalculationSpec extends FunSuite with ParallelTestExecution {

import RouteCalculationSpec._

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import fr.acinq.eclair.router.Announcements.{makeChannelUpdate, makeNodeAnnounce
import fr.acinq.eclair.router.BaseRouterSpec.channelAnnouncement
import fr.acinq.eclair.transactions.Scripts
import fr.acinq.eclair.wire._
import org.scalatest.FunSuiteLike
import org.scalatest.{FunSuiteLike, ParallelTestExecution}
import scodec.bits.HexStringSyntax

import scala.collection.immutable.TreeMap
Expand All @@ -38,7 +38,7 @@ import scala.compat.Platform
import scala.concurrent.duration._


class RoutingSyncSpec extends TestKit(ActorSystem("test")) with FunSuiteLike {
class RoutingSyncSpec extends TestKit(ActorSystem("test")) with FunSuiteLike with ParallelTestExecution {

import RoutingSyncSpec._

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ class ChannelCodecsSpec extends FunSuite {

test("encode/decode origin") {
val id = UUID.randomUUID()
assert(originCodec.decodeValue(originCodec.encode(Local(id, Some(ActorSystem("system").deadLetters))).require).require === Local(id, None))
assert(originCodec.decodeValue(originCodec.encode(Local(id, Some(ActorSystem("test").deadLetters))).require).require === Local(id, None))
// TODO: add backward compatibility check
val relayed = Relayed(randomBytes32, 4324, 12000000 msat, 11000000 msat)
assert(originCodec.decodeValue(originCodec.encode(relayed).require).require === relayed)
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@
<artifactId>scalatest-maven-plugin</artifactId>
<version>2.0.0</version>
<configuration>
<parallel>false</parallel>
<parallel>true</parallel>
<systemProperties>
<buildDirectory>${project.build.directory}</buildDirectory>
</systemProperties>
Expand Down