diff --git a/.github/workflows/Linux_2.12_App_Chain_Core_Tests.yml b/.github/workflows/Linux_2.12_App_Chain_Core_Tests.yml index af2ed7391a..6ae8948e17 100644 --- a/.github/workflows/Linux_2.12_App_Chain_Core_Tests.yml +++ b/.github/workflows/Linux_2.12_App_Chain_Core_Tests.yml @@ -10,6 +10,8 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 60 if: "! contains(github.event.pull_request.labels.*.name, 'documentation')" + env: + PG_STARTUP_WAIT: "60" steps: - name: Checkout uses: actions/checkout@v2 @@ -30,4 +32,4 @@ jobs: ~/.bitcoin-s/binaries key: ${{ runner.os }}-cache - name: run tests - run: sbt ++2.12.15 coverage chainTest/test chain/coverageReport chain/coverageAggregate chain/coveralls cryptoJVM/test cryptoTestJVM/test cryptoJVM/coverageReport cryptoJVM/coverageAggregate cryptoJVM/coveralls coreTestJVM/test dlcTest/test coreJVM/coverageReport coreJVM/coverageAggregate coreJVM/coveralls secp256k1jni/test zmq/test zmq/coverageReport zmq/coverageAggregate zmq/coveralls appCommonsTest/test appServerTest/test oracleServerTest/test lnurlTest/test + run: sbt ++2.12.15 coverage dbCommonsTest/test chainTest/test chain/coverageReport chain/coverageAggregate chain/coveralls cryptoJVM/test cryptoTestJVM/test cryptoJVM/coverageReport cryptoJVM/coverageAggregate cryptoJVM/coveralls coreTestJVM/test dlcTest/test coreJVM/coverageReport coreJVM/coverageAggregate coreJVM/coveralls secp256k1jni/test zmq/test zmq/coverageReport zmq/coverageAggregate zmq/coveralls appCommonsTest/test appServerTest/test oracleServerTest/test lnurlTest/test diff --git a/.github/workflows/Linux_2.13_App_Chain_Core_Tests.yml b/.github/workflows/Linux_2.13_App_Chain_Core_Tests.yml index 0a35610627..c408d02ec3 100644 --- a/.github/workflows/Linux_2.13_App_Chain_Core_Tests.yml +++ b/.github/workflows/Linux_2.13_App_Chain_Core_Tests.yml @@ -10,6 +10,8 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 60 if: "! contains(github.event.pull_request.labels.*.name, 'documentation')" + env: + PG_STARTUP_WAIT: "60" steps: - name: Checkout uses: actions/checkout@v2 @@ -30,4 +32,4 @@ jobs: ~/.bitcoin-s/binaries key: ${{ runner.os }}-cache - name: run tests - run: sbt ++2.13.8 coverage chainTest/test chain/coverageReport chain/coverageAggregate chain/coveralls cryptoTestJVM/test cryptoJVM/test cryptoJVM/coverageReport cryptoJVM/coverageAggregate cryptoJVM/coveralls coreTestJVM/test dlcTest/test coreJVM/coverageReport coreJVM/coverageAggregate coreJVM/coveralls secp256k1jni/test zmq/test zmq/coverageReport zmq/coverageAggregate zmq/coveralls appCommonsTest/test appServerTest/test oracleServerTest/test lnurlTest/test + run: sbt ++2.13.8 coverage dbCommonsTest/test chainTest/test chain/coverageReport chain/coverageAggregate chain/coveralls cryptoTestJVM/test cryptoJVM/test cryptoJVM/coverageReport cryptoJVM/coverageAggregate cryptoJVM/coveralls coreTestJVM/test dlcTest/test coreJVM/coverageReport coreJVM/coverageAggregate coreJVM/coveralls secp256k1jni/test zmq/test zmq/coverageReport zmq/coverageAggregate zmq/coveralls appCommonsTest/test appServerTest/test oracleServerTest/test lnurlTest/test diff --git a/.github/workflows/PostgresTests.yml b/.github/workflows/PostgresTests.yml index 2bf0b2a44a..69794f777d 100644 --- a/.github/workflows/PostgresTests.yml +++ b/.github/workflows/PostgresTests.yml @@ -12,6 +12,8 @@ jobs: if: "! contains(github.event.pull_request.labels.*.name, 'documentation')" env: PG_ENABLED: "1" + PG_STARTUP_WAIT: "60" + TESTCONTAINERS_HOST_OVERRIDE: "localhost" steps: - name: Checkout uses: actions/checkout@v2 @@ -32,4 +34,4 @@ jobs: ~/.bitcoin-s/binaries key: ${{ runner.os }}-cache - name: run tests - run: sbt ++2.13.8 dbCommonsTest/test walletTest/test dlcWalletTest/test chainTest/test nodeTest/test dlcOracle/test + run: sbt ++2.13.8 dbCommonsTest/test walletTest/test dlcWalletTest/test chainTest/test nodeTest/test dlcOracleTest/test diff --git a/.github/workflows/Windows.yml b/.github/workflows/Windows.yml index 04c67627f8..6eea8e06c1 100644 --- a/.github/workflows/Windows.yml +++ b/.github/workflows/Windows.yml @@ -9,6 +9,8 @@ jobs: test: runs-on: windows-latest timeout-minutes: 60 + env: + TESTCONTAINERS_HOST_OVERRIDE: "localhost" if: "! contains(github.event.pull_request.labels.*.name, 'documentation')" steps: - name: Configure git @@ -33,5 +35,5 @@ jobs: ~/.bitcoin-s/binaries key: ${{ runner.os }}-cache - name: Windows Crypto, Core, and Database tests - run: sbt ++2.13.8 cryptoTestJVM/test coreTestJVM/test secp256k1jni/test dlcTest/test appCommonsTest/test dbCommonsTest/test asyncUtilsTestJVM/test asyncUtilsTestJS/test appServerTest/test + run: sbt ++2.13.8 cryptoTestJVM/test coreTestJVM/test secp256k1jni/test dlcTest/test appCommonsTest/test asyncUtilsTestJVM/test asyncUtilsTestJS/test appServerTest/test shell: bash diff --git a/node-test/src/test/scala/org/bitcoins/node/NeutrinoNodeWithWalletTest.scala b/node-test/src/test/scala/org/bitcoins/node/NeutrinoNodeWithWalletTest.scala index 6c70192ad8..93715c9bca 100644 --- a/node-test/src/test/scala/org/bitcoins/node/NeutrinoNodeWithWalletTest.scala +++ b/node-test/src/test/scala/org/bitcoins/node/NeutrinoNodeWithWalletTest.scala @@ -208,7 +208,9 @@ class NeutrinoNodeWithWalletTest extends NodeTestWithCachedBitcoindNewest { _ = assert(!rescan) _ <- wallet.fullRescanNeutrinoWallet(addressBatchSize = 7) - _ <- AsyncUtil.awaitConditionF(condition) + _ <- AsyncUtil.awaitConditionF(condition, + maxTries = 200, + interval = 200.millis) } yield succeed } diff --git a/project/Deps.scala b/project/Deps.scala index b39cacc445..1ef17d5ded 100644 --- a/project/Deps.scala +++ b/project/Deps.scala @@ -45,7 +45,7 @@ object Deps { val scalameterV = "0.17" val scalamockV = "5.2.0" val scalaCollectionCompatV = "2.6.0" - val pgEmbeddedV = "0.13.4" + val pgEmbeddedV = "1.0.1" val breezeV = "1.3" diff --git a/testkit/src/main/scala/org/bitcoins/testkit/EmbeddedPg.scala b/testkit/src/main/scala/org/bitcoins/testkit/EmbeddedPg.scala index 421b5743b2..e8531dd34b 100644 --- a/testkit/src/main/scala/org/bitcoins/testkit/EmbeddedPg.scala +++ b/testkit/src/main/scala/org/bitcoins/testkit/EmbeddedPg.scala @@ -23,8 +23,10 @@ trait EmbeddedPg extends BeforeAndAfterAll { this: Suite => lazy val pg: Option[EmbeddedPostgres] = { if (pgEnabled) { + val pgStartupWait = sys.env.getOrElse("PG_STARTUP_WAIT", "60").toInt val p = EmbeddedPostgres .builder() + .setPGStartupWait(java.time.Duration.ofSeconds(pgStartupWait)) .setServerConfig("max_connections", "25") .setServerConfig("shared_buffers", "1MB") .start() @@ -35,7 +37,7 @@ trait EmbeddedPg extends BeforeAndAfterAll { this: Suite => } def pgUrl(): Option[String] = - pg.map(_.getJdbcUrl(userName = "postgres", dbName = "postgres")) + pg.map(_.getJdbcUrl("postgres")) override def afterAll(): Unit = { super.afterAll() @@ -58,7 +60,7 @@ trait EmbeddedPg extends BeforeAndAfterAll { this: Suite => } finally conn.close() } catch { case ex: Throwable => - println(sql) + System.err.println(sql) ex.printStackTrace() } } diff --git a/testkit/src/main/scala/org/bitcoins/testkit/fixtures/WalletDAOFixture.scala b/testkit/src/main/scala/org/bitcoins/testkit/fixtures/WalletDAOFixture.scala index 39402ec534..904d2b24da 100644 --- a/testkit/src/main/scala/org/bitcoins/testkit/fixtures/WalletDAOFixture.scala +++ b/testkit/src/main/scala/org/bitcoins/testkit/fixtures/WalletDAOFixture.scala @@ -72,6 +72,7 @@ trait WalletDAOFixture extends BitcoinSFixture with EmbeddedPg { private def dropAll(): Future[Unit] = { val res = for { _ <- FutureUtil.sequentially(daos.list.reverse)(dao => dao.deleteAll()) + _ = config.clean() } yield () res.failed.foreach(_.printStackTrace()) res