From 39ef35b9eead4a7057a4f0db4db1fc76794118d2 Mon Sep 17 00:00:00 2001 From: Chris Stewart Date: Fri, 11 Sep 2020 11:10:59 -0500 Subject: [PATCH] Rename parameter names from 'duration' -> 'interval' just like our ActorSystem.schedule() names the parameter (#2005) --- .../bitcoins/bench/eclair/EclairBench.scala | 4 +- .../org/bitcoins/rpc/TestRpcUtilTest.scala | 6 +-- .../bitcoins/rpc/client/common/Client.scala | 2 +- .../org/bitcoins/rpc/util/AsyncUtil.scala | 46 +++++++++---------- .../eclair/rpc/EclairRpcClientTest.scala | 12 ++--- .../eclair/rpc/client/EclairRpcClient.scala | 2 +- .../node/BroadcastTransactionTest.scala | 2 +- .../org/bitcoins/node/NeutrinoNodeTest.scala | 6 +-- .../scala/org/bitcoins/node/SpvNodeTest.scala | 2 +- .../node/networking/P2PClientTest.scala | 2 +- .../peer/PeerMessageHandlerTest.scala | 2 +- .../main/scala/org/bitcoins/node/Node.scala | 2 +- .../eclair/rpc/EclairRpcTestUtil.scala | 14 +++--- .../testkit/rpc/BitcoindRpcTestUtil.scala | 23 +++++----- 14 files changed, 61 insertions(+), 64 deletions(-) diff --git a/bench/src/main/scala/org/bitcoins/bench/eclair/EclairBench.scala b/bench/src/main/scala/org/bitcoins/bench/eclair/EclairBench.scala index 27790a31f4..9c5bbff6fa 100644 --- a/bench/src/main/scala/org/bitcoins/bench/eclair/EclairBench.scala +++ b/bench/src/main/scala/org/bitcoins/bench/eclair/EclairBench.scala @@ -113,13 +113,13 @@ object EclairBench extends App with EclairRpcTestUtil { _ <- sendPayments(network, PaymentAmount, PaymentCount) _ <- TestAsyncUtil.retryUntilSatisfied( condition = paymentLog.size() == NetworkSize * PaymentCount, - duration = 1.second, + interval = 1.second, maxTries = 100) _ <- TestAsyncUtil .retryUntilSatisfied( condition = EclairBenchUtil.paymentLogValues().forall(_.completed), - duration = 1.second, + interval = 1.second, maxTries = 100) .recover { case ex: Throwable => ex.printStackTrace() } _ = println("\nDone!") diff --git a/bitcoind-rpc-test/src/test/scala/org/bitcoins/rpc/TestRpcUtilTest.scala b/bitcoind-rpc-test/src/test/scala/org/bitcoins/rpc/TestRpcUtilTest.scala index a93a586e45..0da1b46751 100644 --- a/bitcoind-rpc-test/src/test/scala/org/bitcoins/rpc/TestRpcUtilTest.scala +++ b/bitcoind-rpc-test/src/test/scala/org/bitcoins/rpc/TestRpcUtilTest.scala @@ -40,7 +40,7 @@ class TestRpcUtilTest extends BitcoindRpcTest { it should "complete immediately if condition is true" in { AsyncUtil .retryUntilSatisfiedF(conditionF = () => Future.successful(true), - duration = 0.millis) + interval = 0.millis) .map { _ => succeed } @@ -50,7 +50,7 @@ class TestRpcUtilTest extends BitcoindRpcTest { recoverToSucceededIf[RpcRetryException] { AsyncUtil.retryUntilSatisfiedF(conditionF = () => Future.successful(false), - duration = 0.millis) + interval = 0.millis) } } @@ -71,7 +71,7 @@ class TestRpcUtilTest extends BitcoindRpcTest { it should "timeout if condition is false" in { recoverToSucceededIf[RpcRetryException] { AsyncUtil - .awaitCondition(condition = () => false, duration = 0.millis) + .awaitCondition(condition = () => false, interval = 0.millis) .map(_ => succeed) } } diff --git a/bitcoind-rpc/src/main/scala/org/bitcoins/rpc/client/common/Client.scala b/bitcoind-rpc/src/main/scala/org/bitcoins/rpc/client/common/Client.scala index ee51ca5863..fd26fa8440 100644 --- a/bitcoind-rpc/src/main/scala/org/bitcoins/rpc/client/common/Client.scala +++ b/bitcoind-rpc/src/main/scala/org/bitcoins/rpc/client/common/Client.scala @@ -142,7 +142,7 @@ trait Client extends BitcoinSLogger with StartStopAsync[BitcoindRpcClient] { for { _ <- awaitCookie(instance.authCredentials) _ <- AsyncUtil.retryUntilSatisfiedF(() => isStartedF, - duration = 1.seconds, + interval = 1.seconds, maxTries = 60) } yield this.asInstanceOf[BitcoindRpcClient] } diff --git a/bitcoind-rpc/src/main/scala/org/bitcoins/rpc/util/AsyncUtil.scala b/bitcoind-rpc/src/main/scala/org/bitcoins/rpc/util/AsyncUtil.scala index e330318ec4..3153330c1a 100644 --- a/bitcoind-rpc/src/main/scala/org/bitcoins/rpc/util/AsyncUtil.scala +++ b/bitcoind-rpc/src/main/scala/org/bitcoins/rpc/util/AsyncUtil.scala @@ -1,13 +1,12 @@ package org.bitcoins.rpc.util import akka.actor.ActorSystem -import org.bitcoins.core.util.BitcoinSLogger +import org.bitcoins.core.util.{BitcoinSLogger, FutureUtil} import scala.concurrent._ import scala.concurrent.duration.{DurationInt, FiniteDuration} abstract class AsyncUtil extends BitcoinSLogger { - import AsyncUtil.DEFAULT_INTERNVAL import AsyncUtil.DEFAULT_MAX_TRIES private def retryRunnable( @@ -23,11 +22,11 @@ abstract class AsyncUtil extends BitcoinSLogger { def retryUntilSatisfied( condition: => Boolean, - duration: FiniteDuration = DEFAULT_INTERNVAL, + interval: FiniteDuration = AsyncUtil.DEFAULT_INTERVAL, maxTries: Int = DEFAULT_MAX_TRIES)(implicit system: ActorSystem): Future[Unit] = { val f = () => Future.successful(condition) - retryUntilSatisfiedF(f, duration, maxTries) + retryUntilSatisfiedF(f, interval, maxTries) } /** @@ -40,14 +39,14 @@ abstract class AsyncUtil extends BitcoinSLogger { */ def retryUntilSatisfiedF( conditionF: () => Future[Boolean], - duration: FiniteDuration = DEFAULT_INTERNVAL, + interval: FiniteDuration = AsyncUtil.DEFAULT_INTERVAL, maxTries: Int = DEFAULT_MAX_TRIES)(implicit system: ActorSystem): Future[Unit] = { val stackTrace: Array[StackTraceElement] = Thread.currentThread().getStackTrace retryUntilSatisfiedWithCounter(conditionF = conditionF, - duration = duration, + interval = interval, maxTries = maxTries, stackTrace = stackTrace) } @@ -79,7 +78,7 @@ abstract class AsyncUtil extends BitcoinSLogger { // Has a different name so that default values are permitted protected def retryUntilSatisfiedWithCounter( conditionF: () => Future[Boolean], - duration: FiniteDuration, + interval: FiniteDuration, counter: Int = 0, maxTries: Int, stackTrace: Array[StackTraceElement])(implicit @@ -89,26 +88,25 @@ abstract class AsyncUtil extends BitcoinSLogger { conditionF().flatMap { condition => if (condition) { - Future.successful(()) + FutureUtil.unit } else if (counter == maxTries) { - Future.failed( - RpcRetryException( - s"Condition timed out after $maxTries attempts with $duration waiting periods", - stackTrace)) + Future.failed(RpcRetryException( + s"Condition timed out after $maxTries attempts with interval=$interval waiting periods", + stackTrace)) } else { val p = Promise[Boolean]() val runnable = retryRunnable(condition, p) - system.scheduler.scheduleOnce(duration, runnable) + system.scheduler.scheduleOnce(delay = interval, runnable = runnable) p.future.flatMap { - case true => Future.successful(()) + case true => FutureUtil.unit case false => - retryUntilSatisfiedWithCounter(conditionF, - duration, - counter + 1, - maxTries, - stackTrace) + retryUntilSatisfiedWithCounter(conditionF = conditionF, + interval = interval, + counter = counter + 1, + maxTries = maxTries, + stackTrace = stackTrace) } } } @@ -124,7 +122,7 @@ abstract class AsyncUtil extends BitcoinSLogger { */ def awaitCondition( condition: () => Boolean, - duration: FiniteDuration = DEFAULT_INTERNVAL, + interval: FiniteDuration = AsyncUtil.DEFAULT_INTERVAL, maxTries: Int = DEFAULT_MAX_TRIES)(implicit system: ActorSystem): Future[Unit] = { @@ -134,17 +132,17 @@ abstract class AsyncUtil extends BitcoinSLogger { val conditionF: () => Future[Boolean] = () => Future.successful(conditionDef) - awaitConditionF(conditionF, duration, maxTries) + awaitConditionF(conditionF, interval, maxTries) } def awaitConditionF( conditionF: () => Future[Boolean], - duration: FiniteDuration = DEFAULT_INTERNVAL, + interval: FiniteDuration = AsyncUtil.DEFAULT_INTERVAL, maxTries: Int = DEFAULT_MAX_TRIES)(implicit system: ActorSystem): Future[Unit] = { retryUntilSatisfiedF(conditionF = conditionF, - duration = duration, + interval = interval, maxTries = maxTries) } @@ -155,7 +153,7 @@ object AsyncUtil extends AsyncUtil { /** * The default interval between async attempts */ - private[bitcoins] val DEFAULT_INTERNVAL: FiniteDuration = 100.milliseconds + private[bitcoins] val DEFAULT_INTERVAL: FiniteDuration = 100.milliseconds /** * The default number of async attempts before timing out diff --git a/eclair-rpc-test/src/test/scala/org/bitcoins/eclair/rpc/EclairRpcClientTest.scala b/eclair-rpc-test/src/test/scala/org/bitcoins/eclair/rpc/EclairRpcClientTest.scala index 0494d515d9..ffc140ea6c 100644 --- a/eclair-rpc-test/src/test/scala/org/bitcoins/eclair/rpc/EclairRpcClientTest.scala +++ b/eclair-rpc-test/src/test/scala/org/bitcoins/eclair/rpc/EclairRpcClientTest.scala @@ -188,7 +188,7 @@ class EclairRpcClientTest extends BitcoinSAsyncTest { } AsyncUtil - .awaitConditionF(hasRoute, duration = 1.second, maxTries = 60) + .awaitConditionF(hasRoute, interval = 1.second, maxTries = 60) .map(_ => succeed) } @@ -207,7 +207,7 @@ class EclairRpcClientTest extends BitcoinSAsyncTest { } AsyncUtil - .awaitConditionF(hasRoute, duration = 1.second, maxTries = 60) + .awaitConditionF(hasRoute, interval = 1.second, maxTries = 60) .map(_ => succeed) } @@ -228,7 +228,7 @@ class EclairRpcClientTest extends BitcoinSAsyncTest { .awaitUntilIncomingPaymentStatus[IncomingPaymentStatus.Received]( client4, invoice.lnTags.paymentHash.hash, - duration = 1.second) + interval = 1.second) _ <- EclairRpcTestUtil.awaitUntilPaymentSucceeded(client1, paymentId, @@ -417,13 +417,13 @@ class EclairRpcClientTest extends BitcoinSAsyncTest { } _ <- TestAsyncUtil.retryUntilSatisfiedF(conditionF = () => eclair.isStarted(), - duration = 1.second, + interval = 1.second, maxTries = 60) _ = EclairRpcTestUtil.shutdown(eclair) _ <- TestAsyncUtil.retryUntilSatisfiedF(conditionF = () => eclair.isStarted().map(!_), - duration = 1.second, + interval = 1.second, maxTries = 60) } yield succeed } @@ -1127,7 +1127,7 @@ class EclairRpcClientTest extends BitcoinSAsyncTest { AsyncUtil .retryUntilSatisfiedF((() => checkUpdates()), - duration = 1.second, + interval = 1.second, maxTries = 60) .transform(_ => succeed, ex => ex) } diff --git a/eclair-rpc/src/main/scala/org/bitcoins/eclair/rpc/client/EclairRpcClient.scala b/eclair-rpc/src/main/scala/org/bitcoins/eclair/rpc/client/EclairRpcClient.scala index d81d6ceafd..a8d8e1c41c 100644 --- a/eclair-rpc/src/main/scala/org/bitcoins/eclair/rpc/client/EclairRpcClient.scala +++ b/eclair-rpc/src/main/scala/org/bitcoins/eclair/rpc/client/EclairRpcClient.scala @@ -778,7 +778,7 @@ class EclairRpcClient( val started: Future[EclairRpcClient] = { for { _ <- AsyncUtil.retryUntilSatisfiedF(() => isStarted, - duration = 1.seconds, + interval = 1.seconds, maxTries = 60) } yield this } diff --git a/node-test/src/test/scala/org/bitcoins/node/BroadcastTransactionTest.scala b/node-test/src/test/scala/org/bitcoins/node/BroadcastTransactionTest.scala index 7d0399d87a..c5aa85d306 100644 --- a/node-test/src/test/scala/org/bitcoins/node/BroadcastTransactionTest.scala +++ b/node-test/src/test/scala/org/bitcoins/node/BroadcastTransactionTest.scala @@ -72,7 +72,7 @@ class BroadcastTransactionTest extends NodeUnitTest { txOpt.isDefined, "Transaction was not added to BroadcastableTransaction database") _ <- TestAsyncUtil.awaitConditionF(() => hasSeenTx(tx), - duration = 1.second, + interval = 1.second, maxTries = 25) } yield () } diff --git a/node-test/src/test/scala/org/bitcoins/node/NeutrinoNodeTest.scala b/node-test/src/test/scala/org/bitcoins/node/NeutrinoNodeTest.scala index 5bbb42dcd6..c285ee7af6 100644 --- a/node-test/src/test/scala/org/bitcoins/node/NeutrinoNodeTest.scala +++ b/node-test/src/test/scala/org/bitcoins/node/NeutrinoNodeTest.scala @@ -131,7 +131,7 @@ class NeutrinoNodeTest extends NodeUnitTest { .chainApiFromDb() .flatMap(_.getBlockCount.map(_ == ExpectedCount)) }, - duration = 1000.millis) + interval = 1000.millis) def hasFilterHeadersF = RpcUtil.retryUntilSatisfiedF( @@ -140,7 +140,7 @@ class NeutrinoNodeTest extends NodeUnitTest { .chainApiFromDb() .flatMap(_.getFilterHeaderCount.map(_ == ExpectedCount)) }, - duration = 1000.millis) + interval = 1000.millis) def hasFiltersF = RpcUtil.retryUntilSatisfiedF( @@ -149,7 +149,7 @@ class NeutrinoNodeTest extends NodeUnitTest { .chainApiFromDb() .flatMap(_.getFilterCount.map(_ == ExpectedCount)) }, - duration = 1000.millis) + interval = 1000.millis) for { _ <- hasBlocksF diff --git a/node-test/src/test/scala/org/bitcoins/node/SpvNodeTest.scala b/node-test/src/test/scala/org/bitcoins/node/SpvNodeTest.scala index 46e5c7f10f..a579534859 100644 --- a/node-test/src/test/scala/org/bitcoins/node/SpvNodeTest.scala +++ b/node-test/src/test/scala/org/bitcoins/node/SpvNodeTest.scala @@ -90,7 +90,7 @@ class SpvNodeTest extends NodeUnitTest { val has6BlocksF = RpcUtil.retryUntilSatisfiedF( conditionF = () => spvNode.chainApiFromDb().flatMap(_.getBlockCount.map(_ == 6)), - duration = 250.millis) + interval = 250.millis) has6BlocksF.map { _ => val isCanceled = cancel.cancel() diff --git a/node-test/src/test/scala/org/bitcoins/node/networking/P2PClientTest.scala b/node-test/src/test/scala/org/bitcoins/node/networking/P2PClientTest.scala index 6151ce3e2f..87e6e8f520 100644 --- a/node-test/src/test/scala/org/bitcoins/node/networking/P2PClientTest.scala +++ b/node-test/src/test/scala/org/bitcoins/node/networking/P2PClientTest.scala @@ -183,7 +183,7 @@ class P2PClientTest extends BitcoindRpcTest with CachedBitcoinSAppConfig { _ = p2pClient.actor ! Tcp.Abort isDisconnected <- TestAsyncUtil.retryUntilSatisfiedF(p2pClient.isDisconnected, - duration = 1.seconds) + interval = 1.seconds) } yield isDisconnected isDisconnectedF.map { _ => diff --git a/node-test/src/test/scala/org/bitcoins/node/networking/peer/PeerMessageHandlerTest.scala b/node-test/src/test/scala/org/bitcoins/node/networking/peer/PeerMessageHandlerTest.scala index 4244d495d3..87214f6423 100644 --- a/node-test/src/test/scala/org/bitcoins/node/networking/peer/PeerMessageHandlerTest.scala +++ b/node-test/src/test/scala/org/bitcoins/node/networking/peer/PeerMessageHandlerTest.scala @@ -36,7 +36,7 @@ class PeerMessageHandlerTest extends NodeUnitTest { val isConnectedF = TestAsyncUtil.retryUntilSatisfiedF( () => p2pClientF.flatMap(_.isConnected), - duration = 500.millis + interval = 500.millis ) val isInitF = isConnectedF.flatMap { _ => diff --git a/node/src/main/scala/org/bitcoins/node/Node.scala b/node/src/main/scala/org/bitcoins/node/Node.scala index b21aad3ec4..1b5af35451 100644 --- a/node/src/main/scala/org/bitcoins/node/Node.scala +++ b/node/src/main/scala/org/bitcoins/node/Node.scala @@ -125,7 +125,7 @@ trait Node extends NodeApi with ChainQueryApi with P2PLogger { val isInitializedF = for { _ <- peerMsgSenderF.map(_.connect()) _ <- AsyncUtil.retryUntilSatisfiedF(() => isInitialized, - duration = 250.millis) + interval = 250.millis) } yield () isInitializedF.failed.foreach(err => diff --git a/testkit/src/main/scala/org/bitcoins/testkit/eclair/rpc/EclairRpcTestUtil.scala b/testkit/src/main/scala/org/bitcoins/testkit/eclair/rpc/EclairRpcTestUtil.scala index 424b83aba9..2e4091ca92 100644 --- a/testkit/src/main/scala/org/bitcoins/testkit/eclair/rpc/EclairRpcTestUtil.scala +++ b/testkit/src/main/scala/org/bitcoins/testkit/eclair/rpc/EclairRpcTestUtil.scala @@ -273,7 +273,7 @@ trait EclairRpcTestUtil extends BitcoinSLogger { } TestAsyncUtil.retryUntilSatisfiedF(conditionF = () => isState(), - duration = 1.seconds) + interval = 1.seconds) } def awaitUntilPaymentSucceeded( @@ -305,7 +305,7 @@ trait EclairRpcTestUtil extends BitcoinSLogger { private def awaitUntilOutgoingPaymentStatus[T <: OutgoingPaymentStatus]( client: EclairApi, paymentId: PaymentId, - duration: FiniteDuration, + interval: FiniteDuration, maxTries: Int, failFast: Boolean)(implicit system: ActorSystem, @@ -341,14 +341,14 @@ trait EclairRpcTestUtil extends BitcoinSLogger { } TestAsyncUtil.retryUntilSatisfiedF(conditionF = () => isInState(), - duration = duration, + interval = interval, maxTries = maxTries) } def awaitUntilIncomingPaymentStatus[T <: IncomingPaymentStatus]( client: EclairApi, paymentHash: Sha256Digest, - duration: FiniteDuration = 1.second, + interval: FiniteDuration = 1.second, maxTries: Int = 60)(implicit system: ActorSystem, tag: ClassTag[T]): Future[Unit] = { @@ -374,7 +374,7 @@ trait EclairRpcTestUtil extends BitcoinSLogger { } TestAsyncUtil.retryUntilSatisfiedF(conditionF = () => isInState(), - duration = duration, + interval = interval, maxTries = maxTries) } @@ -609,7 +609,7 @@ trait EclairRpcTestUtil extends BitcoinSLogger { logger.debug(s"Awaiting connection between clients") val connected = TestRpcUtil.retryUntilSatisfiedF(conditionF = () => isConnected(), - duration = 1.second) + interval = 1.second) connected.map(_ => logger.debug(s"Successfully connected two clients")) @@ -751,7 +751,7 @@ trait EclairRpcTestUtil extends BitcoinSLogger { TestAsyncUtil.retryUntilSatisfiedF(conditionF = () => clientInSync(eclair, bitcoind), - duration = 1.seconds) + interval = 1.seconds) } /** Shuts down an eclair daemon and the bitcoind daemon it is associated with diff --git a/testkit/src/main/scala/org/bitcoins/testkit/rpc/BitcoindRpcTestUtil.scala b/testkit/src/main/scala/org/bitcoins/testkit/rpc/BitcoindRpcTestUtil.scala index ee9276710d..1ea7d33c39 100644 --- a/testkit/src/main/scala/org/bitcoins/testkit/rpc/BitcoindRpcTestUtil.scala +++ b/testkit/src/main/scala/org/bitcoins/testkit/rpc/BitcoindRpcTestUtil.scala @@ -55,7 +55,6 @@ import scala.util._ //noinspection AccessorLikeMethodIsEmptyParen trait BitcoindRpcTestUtil extends BitcoinSLogger { - import BitcoindRpcTestUtil.DEFAULT_LONG_DURATION type RpcClientAccum = mutable.Builder[BitcoindRpcClient, Vector[BitcoindRpcClient]] @@ -344,7 +343,7 @@ trait BitcoindRpcTestUtil extends BitcoinSLogger { def awaitConnection( from: BitcoindRpcClient, to: BitcoindRpcClient, - duration: FiniteDuration = 100.milliseconds, + interval: FiniteDuration = 100.milliseconds, maxTries: Int = 50)(implicit system: ActorSystem): Future[Unit] = { import system.dispatcher @@ -357,7 +356,7 @@ trait BitcoindRpcTestUtil extends BitcoinSLogger { } AsyncUtil.retryUntilSatisfiedF(conditionF = isConnected, - duration = duration, + interval = interval, maxTries = maxTries) } @@ -442,7 +441,7 @@ trait BitcoindRpcTestUtil extends BitcoinSLogger { def awaitSynced( client1: BitcoindRpcClient, client2: BitcoindRpcClient, - duration: FiniteDuration = DEFAULT_LONG_DURATION, + interval: FiniteDuration = BitcoindRpcTestUtil.DEFAULT_LONG_INTERVAL, maxTries: Int = 50)(implicit system: ActorSystem): Future[Unit] = { implicit val ec: ExecutionContextExecutor = system.dispatcher @@ -455,14 +454,14 @@ trait BitcoindRpcTestUtil extends BitcoinSLogger { } AsyncUtil.retryUntilSatisfiedF(conditionF = () => isSynced(), - duration = duration, + interval = interval, maxTries = maxTries) } def awaitSameBlockHeight( client1: BitcoindRpcClient, client2: BitcoindRpcClient, - duration: FiniteDuration = DEFAULT_LONG_DURATION, + interval: FiniteDuration = BitcoindRpcTestUtil.DEFAULT_LONG_INTERVAL, maxTries: Int = 50)(implicit system: ActorSystem): Future[Unit] = { import system.dispatcher @@ -475,14 +474,14 @@ trait BitcoindRpcTestUtil extends BitcoinSLogger { } AsyncUtil.retryUntilSatisfiedF(conditionF = () => isSameBlockHeight(), - duration = duration, + interval = interval, maxTries = maxTries) } def awaitDisconnected( from: BitcoindRpcClient, to: BitcoindRpcClient, - duration: FiniteDuration = 100.milliseconds, + interval: FiniteDuration = 100.milliseconds, maxTries: Int = 50)(implicit system: ActorSystem): Future[Unit] = { import system.dispatcher @@ -500,7 +499,7 @@ trait BitcoindRpcTestUtil extends BitcoinSLogger { } AsyncUtil.retryUntilSatisfiedF(conditionF = () => isDisconnected(), - duration = duration, + interval = interval, maxTries = maxTries) } @@ -559,7 +558,7 @@ trait BitcoindRpcTestUtil extends BitcoinSLogger { val futures = pairs.map { case (first, second) => BitcoindRpcTestUtil - .awaitConnection(first, second, duration = 10.second) + .awaitConnection(first, second, interval = 10.second) } Future.sequence(futures) } @@ -984,7 +983,7 @@ trait BitcoindRpcTestUtil extends BitcoinSLogger { val blocksGeneratedF = generatedF.flatMap { _ => AsyncUtil.retryUntilSatisfiedF( () => areBlocksGenerated(), - duration = DEFAULT_LONG_DURATION + interval = BitcoindRpcTestUtil.DEFAULT_LONG_INTERVAL ) } @@ -999,7 +998,7 @@ object BitcoindRpcTestUtil extends BitcoindRpcTestUtil { /** * Used for long running async tasks */ - private val DEFAULT_LONG_DURATION = { + private val DEFAULT_LONG_INTERVAL = { if (EnvUtil.isMac && EnvUtil.isCI) 10.seconds else 3.seconds }