diff --git a/apps/app/src/test/scala/org/lfdecentralizedtrust/splice/integration/tests/SpliceTests.scala b/apps/app/src/test/scala/org/lfdecentralizedtrust/splice/integration/tests/SpliceTests.scala index c08c9cb6cb..69116bcfd6 100644 --- a/apps/app/src/test/scala/org/lfdecentralizedtrust/splice/integration/tests/SpliceTests.scala +++ b/apps/app/src/test/scala/org/lfdecentralizedtrust/splice/integration/tests/SpliceTests.scala @@ -511,10 +511,11 @@ object SpliceTests extends LazyLogging { def eventuallySucceeds[T]( timeUntilSuccess: FiniteDuration = 20.seconds, maxPollInterval: FiniteDuration = 5.seconds, + suppressErrors: Boolean = true, )(testCode: => T): T = { eventually(timeUntilSuccess, maxPollInterval) { try { - loggerFactory.suppressErrors(testCode) + if (suppressErrors) loggerFactory.suppressErrors(testCode) else testCode } catch { case e: TestFailedException => throw e case NonFatal(e) => fail(e) diff --git a/apps/app/src/test/scala/org/lfdecentralizedtrust/splice/integration/tests/runbook/PreflightIntegrationTestUtil.scala b/apps/app/src/test/scala/org/lfdecentralizedtrust/splice/integration/tests/runbook/PreflightIntegrationTestUtil.scala index 739c505900..5c202e7723 100644 --- a/apps/app/src/test/scala/org/lfdecentralizedtrust/splice/integration/tests/runbook/PreflightIntegrationTestUtil.scala +++ b/apps/app/src/test/scala/org/lfdecentralizedtrust/splice/integration/tests/runbook/PreflightIntegrationTestUtil.scala @@ -20,7 +20,9 @@ trait PreflightIntegrationTestUtil extends TestCommon { override def eventuallySucceeds[T]( timeUntilSuccess: FiniteDuration = this.preflightTimeUntilSuccess, maxPollInterval: FiniteDuration = 5.seconds, - )(testCode: => T): T = super.eventuallySucceeds(timeUntilSuccess, maxPollInterval)(testCode) + suppressErrors: Boolean = true, + )(testCode: => T): T = + super.eventuallySucceeds(timeUntilSuccess, maxPollInterval, suppressErrors)(testCode) override def actAndCheck[T, U]( timeUntilSuccess: FiniteDuration = this.preflightTimeUntilSuccess, diff --git a/apps/app/src/test/scala/org/lfdecentralizedtrust/splice/integration/tests/runbook/ValidatorPreflightIntegrationTest.scala b/apps/app/src/test/scala/org/lfdecentralizedtrust/splice/integration/tests/runbook/ValidatorPreflightIntegrationTest.scala index 6dfba115d1..71cccf0298 100644 --- a/apps/app/src/test/scala/org/lfdecentralizedtrust/splice/integration/tests/runbook/ValidatorPreflightIntegrationTest.scala +++ b/apps/app/src/test/scala/org/lfdecentralizedtrust/splice/integration/tests/runbook/ValidatorPreflightIntegrationTest.scala @@ -91,10 +91,10 @@ abstract class ValidatorPreflightIntegrationTestBase limitValidatorUsers() } - protected def validatorClient: ValidatorAppClientReference = { + protected def validatorClient(suppressErrors: Boolean = true): ValidatorAppClientReference = { val env = provideEnvironment("NotUsed") // retry on e.g. network errors and rate limits - val token = eventuallySucceeds() { + val token = eventuallySucceeds(suppressErrors = suppressErrors) { Auth0Util.getAuth0ClientCredential( validatorAuth0Secret, validatorAuth0Audience, @@ -106,8 +106,7 @@ abstract class ValidatorPreflightIntegrationTestBase } protected def limitValidatorUsers() = { - val client: ValidatorAppClientReference = validatorClient - val users = eventuallySucceeds()(client.listUsers()) + val users = eventuallySucceeds()(validatorClient(suppressErrors = false).listUsers()) val targetNumber = 40 // TODO(tech-debt): consider de-hardcoding this val offboardThreshold = 50 // TODO(tech-debt): consider de-hardcoding this if (users.length > offboardThreshold) { @@ -120,7 +119,7 @@ abstract class ValidatorPreflightIntegrationTestBase .foreach { user => { logger.debug(s"Offboarding user: ${user}") - eventuallySucceeds()(validatorClient.offboardUser(user)) + eventuallySucceeds()(validatorClient(suppressErrors = false).offboardUser(user)) } } } else { @@ -230,7 +229,7 @@ abstract class ValidatorPreflightIntegrationTestBase } clue("Onboard charlie manually to share a party with Bob") { - validatorClient.onboardUser(charlieUser.id, Some(PartyId.tryFromProtoPrimitive(bobPartyId))) + validatorClient().onboardUser(charlieUser.id, Some(PartyId.tryFromProtoPrimitive(bobPartyId))) } withFrontEnd("charlie-validator") { implicit webDriver => @@ -399,7 +398,7 @@ abstract class ValidatorPreflightIntegrationTestBase } "can dump participant identities of validator" in { _ => - validatorClient.dumpParticipantIdentities() + validatorClient().dumpParticipantIdentities() } "connect to all sequencers stated in latest DsoRules contract" in { implicit env => @@ -421,7 +420,7 @@ abstract class ValidatorPreflightIntegrationTestBase .fromUris(NonEmpty.from(availableConnections.map(conn => new URI(conn.url))).value) .value - val domainConnectionConfig = validatorClient.decentralizedSynchronizerConnectionConfig() + val domainConnectionConfig = validatorClient().decentralizedSynchronizerConnectionConfig() val connectedEndpointSet = domainConnectionConfig.sequencerConnections.connections.flatMap(_.endpoints).toSet @@ -536,7 +535,7 @@ class RunbookValidatorPreflightIntegrationTest extends ValidatorPreflightIntegra val (svSequencerEndpoint, _) = Endpoint .fromUris(NonEmpty.from(Seq(new URI(domainConfig.sequencer.toScala.value.url))).value) .value - val domainConnectionConfig = validatorClient.decentralizedSynchronizerConnectionConfig() + val domainConnectionConfig = validatorClient().decentralizedSynchronizerConnectionConfig() val connectedEndpointSet = domainConnectionConfig.sequencerConnections.connections.flatMap(_.endpoints).toSet connectedEndpointSet should contain(svSequencerEndpoint.forgetNE.loneElement.toString)