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

Allocate parties sequentially in script export tests #11389

Merged
merged 2 commits into from
Oct 26, 2021
Merged
Changes from 1 commit
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,6 @@ import com.daml.fs.Utils.deleteRecursively
import com.daml.ledger.api.tls.TlsConfiguration
import com.daml.lf.engine.script.ledgerinteraction.{GrpcLedgerClient, ScriptTimeMode}
import scalaz.syntax.tag._
import scalaz.std.scalaFuture._
import scalaz.std.list._
import scalaz.syntax.traverse._
import spray.json._

import scala.concurrent.Future
Expand Down Expand Up @@ -108,7 +105,13 @@ trait ReproducesTransactions
private def allocateParties(client: LedgerClient, numParties: Int): Future[List[Ref.Party]] =
List
.range(0, numParties)
.traverse(_ => client.partyManagementClient.allocateParty(None, None).map(_.party))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Turns out it was not traverse.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don’t worry, sequential traverse is still a valid traverse

// Allocate parties sequentially to avoid timeouts on CI.
.foldLeft[Future[List[Ref.Party]]](Future.successful(Nil)) { case (acc, _) =>
for {
ps <- acc
p <- client.partyManagementClient.allocateParty(None, None).map(_.party)
} yield ps :+ p
}

private val ledgerBegin = LedgerOffset(
LedgerOffset.Value.Boundary(LedgerOffset.LedgerBoundary.LEDGER_BEGIN)
Expand Down