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

Remove append only prefix from conformance tests [KVL-1152] #11424

Merged
merged 7 commits into from
Oct 28, 2021
Merged
Show file tree
Hide file tree
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 @@ -191,10 +191,9 @@ private[testtool] abstract class CommandDeduplicationBase(
}
)

// appendOnlySchema - without the submission id we cannot assert the received completions for parallel submissions
// staticTime - we run calls in parallel and with static time we would need to advance the time,
// therefore this cannot be run in static time
if (deduplicationFeatures.appendOnlySchema && !staticTime)
if (!staticTime)
testGivenAllParticipants(
s"${testNamingPrefix}SimpleDeduplicationMixedClients",
"Deduplicate commands within the deduplication time window using the command client and the command submission client",
Expand Down Expand Up @@ -414,15 +413,11 @@ private[testtool] abstract class CommandDeduplicationBase(
val submissionId = UUID.randomUUID().toString
submitRequest(ledger)(request.update(_.commands.submissionId := submissionId))
.flatMap(ledgerEnd => {
if (deduplicationFeatures.appendOnlySchema)
// The [[Completion.submissionId]] is set only for append-only ledgers
ledger
.findCompletion(ledger.completionStreamRequest(ledgerEnd)(parties: _*))(
_.submissionId == submissionId
)
.map[Seq[Completion]](_.toList)
else
ledger.firstCompletions(ledger.completionStreamRequest(ledgerEnd)(parties: _*))
ledger
.findCompletion(ledger.completionStreamRequest(ledgerEnd)(parties: _*))(
_.submissionId == submissionId
)
.map[Seq[Completion]](_.toList)
})
.map { completions =>
assertSingleton("Expected only one completion", completions)
Expand Down Expand Up @@ -455,11 +450,8 @@ object CommandDeduplicationBase {
}

/** @param participantDeduplication If participant deduplication is enabled then we will receive synchronous rejections
* @param appendOnlySchema For [[Completion]], the submission id and deduplication period are filled only for append only schemas
* Therefore, we need to assert on those fields only if it's an append only schema
*/
case class DeduplicationFeatures(
participantDeduplication: Boolean,
appendOnlySchema: Boolean,
participantDeduplication: Boolean
)
}

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ final class CommandDeduplicationIT(

override def deduplicationFeatures: CommandDeduplicationBase.DeduplicationFeatures =
DeduplicationFeatures(
participantDeduplication = true,
appendOnlySchema = false,
participantDeduplication = true
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,10 @@ import io.grpc.Status.Code
import scala.collection.compat._
import scala.concurrent.duration._
import scala.concurrent.{ExecutionContext, Future}
import scala.util.{Failure, Random, Success}
import scala.util.control.NonFatal
import scala.util.{Failure, Random, Success}

/** Should be enabled for ledgers that fill the submission ID in the completions,
* as we need to use the submission id to find completions for parallel submissions
*/
class AppendOnlyCommandDeduplicationParallelIT extends LedgerTestSuite {
class CommandDeduplicationParallelIT extends LedgerTestSuite {

private val deduplicationDuration = 3.seconds
private val numberOfParallelRequests = 10
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import com.daml.ledger.api.SubmissionIdGenerator
import com.daml.ledger.api.testtool.infrastructure.Allocation._
import com.daml.ledger.api.testtool.infrastructure.LedgerTestSuite
import com.daml.ledger.api.testtool.infrastructure.participant.ParticipantTestContext
import com.daml.ledger.api.testtool.suites.AppendOnlyCompletionDeduplicationInfoIT._
import com.daml.ledger.api.testtool.suites.CompletionDeduplicationInfoIT._
import com.daml.ledger.api.v1.command_service.SubmitAndWaitRequest
import com.daml.ledger.api.v1.command_submission_service.SubmitRequest
import com.daml.ledger.api.v1.commands.Command
Expand All @@ -24,7 +24,7 @@ import io.grpc.Status
import scala.concurrent.duration.DurationInt
import scala.concurrent.{ExecutionContext, Future}

final class AppendOnlyCompletionDeduplicationInfoIT[ServiceRequest](
final class CompletionDeduplicationInfoIT[ServiceRequest](
service: Service[ServiceRequest]
) extends LedgerTestSuite {

Expand Down Expand Up @@ -56,7 +56,7 @@ final class AppendOnlyCompletionDeduplicationInfoIT[ServiceRequest](
})
}

private[testtool] object AppendOnlyCompletionDeduplicationInfoIT {
private[testtool] object CompletionDeduplicationInfoIT {

private[testtool] sealed trait Service[ProtoRequestType] extends Serializable with Product {
def buildRequest(
Expand Down
Loading