Skip to content

Commit

Permalink
Remove append only prefix from conformance tests [KVL-1152] (#11424)
Browse files Browse the repository at this point in the history
CHANGELOG_BEGIN
[api-test-tool] - remove AppendOnly prefix from test suites as the append-only schema is the only one left
CHANGELOG_END
  • Loading branch information
nicu-da authored Oct 28, 2021
1 parent 926655d commit 6126fc2
Show file tree
Hide file tree
Showing 15 changed files with 242 additions and 370 deletions.
15 changes: 13 additions & 2 deletions compatibility/bazel_tools/testing.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,6 @@ excluded_test_tool_tests = [
"exclusions": [
"KVCommandDeduplicationIT:KVCommandDeduplicationDeduplicateSubmitterBasic",
"KVCommandDeduplicationIT:KVCommandDeduplicationSimpleDeduplicationBasic",
"KVCommandDeduplicationIT:KVCommandDeduplicationCommitterDeduplication",
],
},
],
Expand All @@ -497,7 +496,7 @@ excluded_test_tool_tests = [
},
{
"start": "1.17.0-snapshot.20210915.7841.0.b4328b3d", # The first version this test appeared
"end": "1.18.0-snapshot.20210928.7948.0.b4d00317",
"end": "1.18.0-snapshot.20211026.8179.0.e474b2d1", # The version when this test was removed
"platform_ranges": [
{
"start": "1.18.0-snapshot.20210928.7948.1",
Expand Down Expand Up @@ -531,6 +530,18 @@ excluded_test_tool_tests = [
},
],
},
{
"start": "1.18.0-snapshot.20211026.8179.0.e474b2d1",
"platform_ranges": [
{
"end": "1.18.0-snapshot.20211026.8179.0.e474b2d1",
"exclusions": [
"KVCommandDeduplicationIT:KVCommandDeduplicationSimpleDeduplicationMixedClients",
"CommandDeduplicationIT", # Latest version of the test is dependent on having the submission id populated
],
},
],
},
]

def in_range(version, range):
Expand Down
6 changes: 3 additions & 3 deletions ledger/daml-on-sql/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,9 @@ conformance_test(
test_tool_args = [
"--verbose",
"--additional=MultiPartySubmissionIT",
"--additional=AppendOnlyCommandDeduplicationParallelIT",
"--additional=AppendOnlyCompletionDeduplicationInfoITCommandService",
"--additional=AppendOnlyCompletionDeduplicationInfoITCommandSubmissionService",
"--additional=CommandDeduplicationParallelIT",
"--additional=CompletionDeduplicationInfoITCommandService",
"--additional=CompletionDeduplicationInfoITCommandSubmissionService",
"--additional=ContractIdIT:Accept",
],
)
Expand Down
12 changes: 6 additions & 6 deletions ledger/ledger-api-test-tool-on-canton/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,11 @@ conformance_test(
",ExceptionsIT,ExceptionRaceConditionIT" + # need UCK mode - added below
",DeeplyNestedValueIT" + # FIXME: Too deeply nested values flake with a time out (half of the time)
",CommandServiceIT:CSReturnStackTrace" + # FIXME: Ensure canton returns stack trace
",CommandDeduplicationIT:ParticipantCommandDeduplicationSimpleDeduplicationBasic,CommandDeduplicationIT:ParticipantCommandDeduplicationDeduplicateSubmitterBasic" + # sync vs async error (part of canton #6301)
",CommandDeduplicationIT:ParticipantCommandDeduplicationSimpleDeduplicationBasic,CommandDeduplicationIT:ParticipantCommandDeduplicationDeduplicateSubmitterBasic,CommandDeduplicationIT:ParticipantCommandDeduplicationSimpleDeduplicationMixedClients" + # sync vs async error (part of canton #6301)
# Also exclude "optional tests" - which are run separately below
",AppendOnlyCompletionDeduplicationInfoITCommandService" +
",AppendOnlyCompletionDeduplicationInfoITCommandSubmissionService" +
",AppendOnlyCommandDeduplicationParallelIT" +
",CompletionDeduplicationInfoITCommandService" +
",CompletionDeduplicationInfoITCommandSubmissionService" +
",CommandDeduplicationParallelIT" +
",ContractIdIT" +
",MultiPartySubmissionIT" +
",ParticipantPruningIT" +
Expand Down Expand Up @@ -161,8 +161,8 @@ conformance_test(
"--verbose",
"--include=ContractIdIT:RejectV0,ContractIdIT:RejectNonSuffixedV1Cid,ContractIdIT:AcceptSuffixedV1Cid" +
",MultiPartySubmissionIT" +
# ",AppendOnlyCommandDeduplicationParallelIT" + # FIXME: Deduplication test not yet passing on canton - canton-#6301
",AppendOnlyCompletionDeduplicationInfoITCommandService,AppendOnlyCompletionDeduplicationInfoITCommandSubmissionService",
# ",CommandDeduplicationParallelIT" + # FIXME: Deduplication test not yet passing on canton - canton-#6301
",CompletionDeduplicationInfoITCommandService,CompletionDeduplicationInfoITCommandSubmissionService",
"--exclude=MultiPartySubmissionIT:MPSLookupOtherByKeyInvisible" + # Enable once error parsing more permissive
",MultiPartySubmissionIT:MPSCreateInsufficientAuthorization" + # canton returns INTERNAL instead of INVALID_ARGUMENT
",ContractIdIT:AcceptSuffixedV1CidExerciseTarget", # Racy with: ABORTED: CONTRACT_NOT_FOUND(14,0): Contract could not be found with id
Expand Down
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 All @@ -221,7 +220,10 @@ private[testtool] abstract class CommandDeduplicationBase(
)
val submitRequest = ledger
.submitRequest(party, Dummy(party).create.command)
.update(_.commands.commandId := submitAndWaitRequest.getCommands.commandId)
.update(
_.commands.commandId := submitAndWaitRequest.getCommands.commandId,
_.commands.deduplicationTime := deduplicationDuration.asProtobuf,
)

def submitAndAssertAccepted(submitAndWait: Boolean) = {
if (submitAndWait) ledger.submitAndWait(submitAndWaitRequest)
Expand Down Expand Up @@ -414,15 +416,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 +453,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.

Loading

0 comments on commit 6126fc2

Please sign in to comment.