Fix conformance test for canton dev (#14866)

CHANGELOG_BEGIN
CHANGELOG_END
This commit is contained in:
Remy 2022-08-30 15:52:39 +02:00 committed by GitHub
parent 7f3552f87e
commit 7f4aefd09a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 211 additions and 58 deletions

View File

@ -47,54 +47,85 @@ sh_binary(
deps = ["@bazel_tools//tools/bash/runfiles"],
) if not is_windows else None
conformance_test_extra_data_base = [
":canton_deploy.jar",
":logback-debug.xml",
"@coreutils_nix//:bin/base64",
"@curl_nix//:bin/curl",
"@grpcurl_nix//:bin/grpcurl",
"@jq_dev_env//:jq",
"@bazel_tools//tools/jdk",
]
conformance_test_ports = [
5011,
5021,
5031,
5041,
]
conformance_test_tool_args = [
"--verbose",
"--concurrent-test-runs=1", # lowered from default #procs to reduce flakes - details in https://github.com/digital-asset/daml/issues/7316
"--timeout-scale-factor=2", # increased to reduce flakes particularly wrt timeouts in TransactionService*IT tests
"--exclude=" + ",".join([
# dynamic config management not supported by Canton
"ConfigManagementServiceIT",
"LedgerConfigurationServiceIT",
"ClosedWorldIT", # Canton currently fails this test with a different error (missing namespace in "unallocated" party id)
"ParticipantPruningIT", # pruning not supported in Canton Community
# tests with special config run in canton enterprise-repo
"TLSOnePointThreeIT",
"TLSAtLeastOnePointTwoIT",
"CommandDeduplicationPeriodValidationIT:OffsetPruned", # requires pruning not available in canton community
"DeeplyNestedValueIT", # FIXME: Too deeply nested values flake with a time out (half of the time)
]),
]
conformance_test(
name = "conformance-test",
dev_mod_flag = "-C _shared.participant_parameters.unsafe-enable-daml-lf-dev-version=true",
extra_data = [
":bootstrap.canton",
":canton_deploy.jar",
":canton.conf",
":logback-debug.xml",
"@coreutils_nix//:bin/base64",
"@curl_nix//:bin/curl",
"@grpcurl_nix//:bin/grpcurl",
"@jq_dev_env//:jq",
"@bazel_tools//tools/jdk",
],
extra_data =
conformance_test_extra_data_base + [
":bootstrap.canton",
":canton.conf",
],
extra_runner_args = ["7000"],
lf_versions = [
"default",
"latest",
# TODO. reactive once canton include the fix to TransactionVersion.scala made in #14800
# "preview",
# TOD reactivate once we figure out why it is failing
# "dev",
],
ports = [
5011,
5021,
5031,
5041,
],
preview_mod_flag = "-C _shared.participant_parameters.unsafe-enable-daml-lf-dev-version=true",
ports = conformance_test_ports,
runner = "@//bazel_tools/client_server/runner_with_health_check",
server = ":canton-test-runner-with-dependencies",
server_args = [],
test_tool_args = [
"--verbose",
"--concurrent-test-runs=1", # lowered from default #procs to reduce flakes - details in https://github.com/digital-asset/daml/issues/7316
"--timeout-scale-factor=2", # increased to reduce flakes particularly wrt timeouts in TransactionService*IT tests
"--exclude=" + ",".join([
# dynamic config management not supported by Canton
"ConfigManagementServiceIT",
"LedgerConfigurationServiceIT",
"ClosedWorldIT", # Canton currently fails this test with a different error (missing namespace in "unallocated" party id)
"ParticipantPruningIT", # pruning not supported in Canton Community
# tests with special config run in canton enterprise-repo
"TLSOnePointThreeIT",
"TLSAtLeastOnePointTwoIT",
"CommandDeduplicationPeriodValidationIT:OffsetPruned", # requires pruning not available in canton community
"DeeplyNestedValueIT", # FIXME: Too deeply nested values flake with a time out (half of the time)
]),
server_args = [
"--config=$$(canonicalize_rlocation $(rootpath :canton.conf))",
"--bootstrap=$$(canonicalize_rlocation $(rootpath :bootstrap.canton))",
],
test_tool_args = conformance_test_tool_args,
) if not is_windows else None
conformance_test(
name = "conformance-test-dev-domain",
dev_mod_flag = "",
extra_data =
conformance_test_extra_data_base + [
":bootstrap-dev.canton",
":canton-dev.conf",
],
extra_runner_args = ["7000"],
lf_versions = [
"default",
# TODO. reactive once canton include the fix to TransactionVersion.scala made in #14800
# "preview",
"dev",
],
ports = conformance_test_ports,
preview_mod_flag = "",
runner = "@//bazel_tools/client_server/runner_with_health_check",
server = ":canton-test-runner-with-dependencies",
server_args = [
"--config=$$(canonicalize_rlocation $(rootpath :canton-dev.conf))",
"--bootstrap=$$(canonicalize_rlocation $(rootpath :bootstrap-dev.canton))",
],
test_tool_args = conformance_test_tool_args,
) if not is_windows else None

View File

@ -0,0 +1,17 @@
nodes.local.start
test_domain.service.set_mediator_deduplication_timeout(6.minutes)
test_domain.service.update_dynamic_domain_parameters(_.update(
ledgerTimeRecordTimeTolerance = 3.minutes,
mediatorReactionTimeout = 1.minute,
participantResponseTimeout = 1.minute,
),
force = true,
)
participants.local foreach (_.domains.connect_local(test_domain))
utils.retry_until_true {
participants.local forall (_.domains.active(test_domain.name))
}

View File

@ -0,0 +1,122 @@
# Copyright (c) 2022 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
_shared {
participant_parameters {
will-corrupt-your-system-dev-version-support = yes
unsafe-enable-daml-lf-dev-version = yes
}
}
canton {
features.enable-preview-commands = yes
domains {
test_domain {
storage {
type = memory
}
crypto.provider = tink
public-api.port = 4011
admin-api.port = 4012
domain-parameters {
max-rate-per-participant = 10000
will-corrupt-your-system-dev-version-support = yes
protocol-version = dev
}
}
}
participants {
participant_1 {
storage {
type = "h2"
config = {
url = "jdbc:h2:mem:db1;MODE=PostgreSQL;LOCK_TIMEOUT=10000;DB_CLOSE_DELAY=-1"
user = "participant_1"
password = "pwd"
driver = org.h2.Driver
}
}
crypto.provider = tink
ledger-api.port = 5011
admin-api.port = 5012
parameters = ${_shared.participant_parameters}
}
participant_2 {
storage {
type = "h2"
config = {
url = "jdbc:h2:mem:db2;MODE=PostgreSQL;LOCK_TIMEOUT=10000;DB_CLOSE_DELAY=-1"
user = "participant_2"
password = "pwd"
driver = org.h2.Driver
}
}
crypto.provider = tink
ledger-api.port = 5021
admin-api.port = 5022
parameters = ${_shared.participant_parameters}
}
participant_3 {
storage {
type = "h2"
config = {
url = "jdbc:h2:mem:db3;MODE=PostgreSQL;LOCK_TIMEOUT=10000;DB_CLOSE_DELAY=-1"
user = "participant_3"
password = "pwd"
driver = org.h2.Driver
}
}
crypto.provider = tink
ledger-api.port = 5031
admin-api.port = 5032
parameters = ${_shared.participant_parameters}
}
participant_4 {
storage {
type = "h2"
config = {
url = "jdbc:h2:mem:db4;MODE=PostgreSQL;LOCK_TIMEOUT=10000;DB_CLOSE_DELAY=-1"
user = "participant_4"
password = "pwd"
driver = org.h2.Driver
}
}
crypto.provider = tink
ledger-api.port = 5041
admin-api.port = 5042
parameters = ${_shared.participant_parameters}
}
}
monitoring.health {
server.port = 7000
check {
type = ping
participant = participant_1
interval = 5s
timeout = 20s
}
}
}

View File

@ -8,24 +8,7 @@ set -o pipefail
JAVA="$(rlocation local_jdk/bin/java)"
CANTON_COMMAND=(
"$(rlocation com_github_digital_asset_daml/ledger/ledger-api-test-tool-on-canton/canton_deploy.jar)"
daemon
"--config=$(rlocation com_github_digital_asset_daml/ledger/ledger-api-test-tool-on-canton/canton.conf)"
"--bootstrap=$(rlocation com_github_digital_asset_daml/ledger/ledger-api-test-tool-on-canton/bootstrap.canton)"
)
command=("${CANTON_COMMAND[@]}" "$@")
export UNIQUE_CONTRACT_KEYS="$(rlocation com_github_digital_asset_daml/ledger/ledger-api-test-tool-on-canton/unique-contract-keys.conf)"
if [[ -f ${UNIQUE_CONTRACT_KEYS} ]]; then
command+=("--config=${UNIQUE_CONTRACT_KEYS}")
fi
export ENABLE_FASTER_PRUNING="$(rlocation com_github_digital_asset_daml/ledger/ledger-api-test-tool-on-canton/enable-faster-pruning.conf)"
if [[ -f ${ENABLE_FASTER_PRUNING} ]]; then
command+=("--config=${ENABLE_FASTER_PRUNING}")
fi
command=("$(rlocation com_github_digital_asset_daml/ledger/ledger-api-test-tool-on-canton/canton_deploy.jar)" daemon "$@")
# Change HOME since Canton uses ammonite in the default configuration, which tries to write to
# ~/.ammonite/cache, which is read-only when sandboxing is enabled.