Skip to content

Commit f1f4a92

Browse files
Move participant pruning test to ManualStartIntegrationTest (#3282)
Signed-off-by: Julien Tinguely <julien.tinguely@digitalasset.com>
1 parent c09c0cc commit f1f4a92

File tree

3 files changed

+84
-98
lines changed

3 files changed

+84
-98
lines changed

apps/app/src/test/scala/org/lfdecentralizedtrust/splice/integration/tests/ManualStartIntegrationTest.scala

Lines changed: 59 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import org.lfdecentralizedtrust.splice.integration.tests.SpliceTests.{
2323
IntegrationTest,
2424
SpliceTestConsoleEnvironment,
2525
}
26+
import org.lfdecentralizedtrust.splice.store.AppStoreWithIngestion.SpliceLedgerConnectionPriority.Low
2627
import org.lfdecentralizedtrust.splice.sv.config.SvAppBackendConfig
2728
import org.lfdecentralizedtrust.splice.util.{StandaloneCanton, TriggerTestUtil, WalletTestUtil}
2829

@@ -55,22 +56,46 @@ class ManualStartIntegrationTest
5556
.addConfigTransforms((_, conf) => ConfigTransforms.bumpCantonPortsBy(22_000)(conf))
5657
// By default, alice validator connects to the splitwell domain. This test doesn't start the splitwell node.
5758
.addConfigTransform((_, conf) =>
58-
conf.copy(validatorApps =
59-
conf.validatorApps.updatedWith(InstanceName.tryCreate("aliceValidator")) {
60-
_.map { aliceValidatorConfig =>
61-
val withoutExtraDomains = aliceValidatorConfig.domains.copy(extra = Seq.empty)
62-
aliceValidatorConfig.copy(
63-
domains = withoutExtraDomains,
64-
participantPruningSchedule = Some(
65-
PruningConfig(
66-
"0 0 * * * ?",
67-
PositiveDurationSeconds.tryFromDuration(1.hours),
68-
PositiveDurationSeconds.tryFromDuration(30.hours),
69-
)
70-
),
59+
conf.copy(
60+
// reduce it so that the test hits 2 acs commitments intervals
61+
// as pruning can be done only up to the end of the latest complete acs commitment interval
62+
svApps = conf.svApps.updatedWith(InstanceName.tryCreate("sv1")) {
63+
_.map { config =>
64+
config.copy(acsCommitmentReconciliationInterval =
65+
PositiveDurationSeconds.ofSeconds(30)
7166
)
7267
}
73-
}
68+
},
69+
validatorApps = conf.validatorApps
70+
.updatedWith(InstanceName.tryCreate("sv1Validator")) {
71+
_.map { config =>
72+
config.copy(
73+
// schedule needs to be defined to activate participant pruning
74+
participantPruningSchedule = Some(
75+
PruningConfig(
76+
"0 /1 * * * ?",
77+
PositiveDurationSeconds.tryFromDuration(10.seconds),
78+
PositiveDurationSeconds.tryFromDuration(20.seconds),
79+
)
80+
)
81+
)
82+
}
83+
}
84+
.updatedWith(InstanceName.tryCreate("aliceValidator")) {
85+
_.map { aliceValidatorConfig =>
86+
val withoutExtraDomains = aliceValidatorConfig.domains.copy(extra = Seq.empty)
87+
aliceValidatorConfig.copy(
88+
domains = withoutExtraDomains,
89+
participantPruningSchedule = Some(
90+
PruningConfig(
91+
"0 0 * * * ?",
92+
PositiveDurationSeconds.tryFromDuration(1.hours),
93+
PositiveDurationSeconds.tryFromDuration(30.hours),
94+
)
95+
),
96+
)
97+
}
98+
},
7499
)
75100
)
76101
// Add a suffix to the canton identifiers to avoid metric conflicts with the shared canton nodes
@@ -152,6 +177,26 @@ class ManualStartIntegrationTest
152177
startAllSync(allCnApps*)
153178
}
154179

180+
clue("Check sv1 participant has the expected smallest pruning schedule") {
181+
sv1ValidatorBackend.participantClient.pruning.get_schedule() shouldBe Some(
182+
PruningSchedule(
183+
"0 /1 * * * ?",
184+
PositiveDurationSeconds.tryFromDuration(10.seconds),
185+
PositiveDurationSeconds.tryFromDuration(20.seconds),
186+
)
187+
)
188+
}
189+
190+
clue("Check sv1 participant is actively pruning") {
191+
eventually(2.minutes) {
192+
sv1Backend.svAutomation
193+
.connection(Low)
194+
// returns 0 when participant pruning is disabled
195+
.latestPrunedOffset()
196+
.futureValue should be > 0L
197+
}
198+
}
199+
155200
clue(
156201
"All Canton nodes have identity and signing keys different from their namespace keys"
157202
) {

apps/app/src/test/scala/org/lfdecentralizedtrust/splice/integration/tests/PruningIntegrationTest.scala renamed to apps/app/src/test/scala/org/lfdecentralizedtrust/splice/integration/tests/SequencerPruningIntegrationTest.scala

Lines changed: 24 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,21 @@
11
package org.lfdecentralizedtrust.splice.integration.tests
22

3-
import com.digitalasset.canton.admin.api.client.data.PruningSchedule
4-
import org.lfdecentralizedtrust.splice.config.{
5-
ConfigTransforms,
6-
ParticipantClientConfig,
7-
PruningConfig,
8-
}
3+
import org.lfdecentralizedtrust.splice.config.{ConfigTransforms, ParticipantClientConfig}
94
import org.lfdecentralizedtrust.splice.console.ValidatorAppBackendReference
105
import org.lfdecentralizedtrust.splice.sv.automation.singlesv.SequencerPruningTrigger
116
import org.lfdecentralizedtrust.splice.sv.config.SequencerPruningConfig
127
import org.lfdecentralizedtrust.splice.util.{ProcessTestUtil, WalletTestUtil}
138
import org.lfdecentralizedtrust.splice.validator.automation.ReconcileSequencerConnectionsTrigger
149
import com.digitalasset.canton.config.CantonRequireTypes.InstanceName
15-
import com.digitalasset.canton.config.{
16-
FullClientConfig,
17-
NonNegativeFiniteDuration,
18-
PositiveDurationSeconds,
19-
}
10+
import com.digitalasset.canton.config.{FullClientConfig, NonNegativeFiniteDuration}
2011
import com.digitalasset.canton.config.RequireTypes.Port
2112
import com.digitalasset.canton.logging.SuppressionRule
2213
import com.digitalasset.canton.util.ShowUtil.*
23-
import org.lfdecentralizedtrust.splice.store.AppStoreWithIngestion.SpliceLedgerConnectionPriority.Low
2414
import org.slf4j.event.Level
2515

2616
import scala.concurrent.duration.*
2717

28-
class PruningIntegrationTest
18+
class SequencerPruningIntegrationTest
2919
extends SvIntegrationTestBase
3020
with WalletTestUtil
3121
with ProcessTestUtil {
@@ -62,79 +52,31 @@ class PruningIntegrationTest
6252
)(config),
6353
(_, config) =>
6454
config.copy(
65-
// reduce it so that the test hits 2 acs commitments intervals
66-
// as pruning can be done only up to the end of the latest complete acs commitment interval
67-
svApps = config.svApps.updatedWith(InstanceName.tryCreate("sv1")) {
68-
_.map { config =>
69-
config.copy(acsCommitmentReconciliationInterval =
70-
PositiveDurationSeconds.ofSeconds(30)
71-
)
72-
}
73-
},
74-
validatorApps =
75-
config.validatorApps.updatedWith(InstanceName.tryCreate("sv1Validator")) {
76-
_.map { config =>
77-
config.copy(
78-
// schedule needs to be defined to activate participant pruning
79-
participantPruningSchedule = Some(
80-
PruningConfig(
81-
"0 /1 * * * ?",
82-
PositiveDurationSeconds.tryFromDuration(10.seconds),
83-
PositiveDurationSeconds.tryFromDuration(20.seconds),
84-
)
85-
)
86-
)
87-
}
88-
} + (
89-
InstanceName.tryCreate("bobValidatorLocal") -> {
90-
val bobValidatorConfig = config
91-
.validatorApps(InstanceName.tryCreate("bobValidator"))
92-
bobValidatorConfig
93-
.copy(
94-
participantClient = ParticipantClientConfig(
95-
FullClientConfig(port = Port.tryCreate(5902)),
96-
bobValidatorConfig.participantClient.ledgerApi.copy(
97-
clientConfig =
98-
bobValidatorConfig.participantClient.ledgerApi.clientConfig.copy(
99-
port = Port.tryCreate(5901)
100-
)
101-
),
55+
validatorApps = config.validatorApps + (
56+
InstanceName.tryCreate("bobValidatorLocal") -> {
57+
val bobValidatorConfig = config
58+
.validatorApps(InstanceName.tryCreate("bobValidator"))
59+
bobValidatorConfig
60+
.copy(
61+
participantClient = ParticipantClientConfig(
62+
FullClientConfig(port = Port.tryCreate(5902)),
63+
bobValidatorConfig.participantClient.ledgerApi.copy(
64+
clientConfig =
65+
bobValidatorConfig.participantClient.ledgerApi.clientConfig.copy(
66+
port = Port.tryCreate(5901)
67+
)
10268
),
103-
// We disable the ReconcileSequencerConnectionsTrigger to prevent domain disconnections
104-
// from interfering with traffic top-ups (see #14474)
105-
automation = bobValidatorConfig.automation
106-
.withPausedTrigger[ReconcileSequencerConnectionsTrigger],
107-
)
108-
}
109-
),
69+
),
70+
// We disable the ReconcileSequencerConnectionsTrigger to prevent domain disconnections
71+
// from interfering with traffic top-ups (see #14474)
72+
automation = bobValidatorConfig.automation
73+
.withPausedTrigger[ReconcileSequencerConnectionsTrigger],
74+
)
75+
}
76+
)
11077
),
11178
)
11279

113-
"participant can be pruned" should {
114-
115-
"when configured, sv1 participant prunes every minute" in { implicit env =>
116-
initDsoWithSv1Only()
117-
118-
clue("Check sv1 participant has the expected smallest pruning schedule") {
119-
sv1ValidatorBackend.participantClient.pruning.get_schedule() shouldBe Some(
120-
PruningSchedule(
121-
"0 /1 * * * ?",
122-
PositiveDurationSeconds.tryFromDuration(10.seconds),
123-
PositiveDurationSeconds.tryFromDuration(20.seconds),
124-
)
125-
)
126-
}
127-
128-
eventually(2.minutes) {
129-
sv1Backend.svAutomation
130-
.connection(Low)
131-
// returns 0 when participant pruning is disabled
132-
.latestPrunedOffset()
133-
.futureValue should be > 0L
134-
}
135-
}
136-
}
137-
13880
"sequencer can be pruned even if a participant is down" in { implicit env =>
13981
clue("Initialize DSO with 2 SVs") {
14082
startAllSync(
@@ -197,5 +139,4 @@ class PruningIntegrationTest
197139
timeUntilSuccess = 3.minutes,
198140
)
199141
}
200-
201142
}

test-full-class-names.log

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@ org.lfdecentralizedtrust.splice.integration.tests.FeaturedAppActivityMarkerInteg
1717
org.lfdecentralizedtrust.splice.integration.tests.GcpBucketPeriodicBackupIntegrationTest
1818
org.lfdecentralizedtrust.splice.integration.tests.MemberTrafficIntegrationTest
1919
org.lfdecentralizedtrust.splice.integration.tests.ParticipantPlaintextIdentitiesIntegrationTest
20-
org.lfdecentralizedtrust.splice.integration.tests.PruningIntegrationTest
2120
org.lfdecentralizedtrust.splice.integration.tests.RecoverExternalPartyIntegrationTest
2221
org.lfdecentralizedtrust.splice.integration.tests.RewardExpiryIntegrationTest
2322
org.lfdecentralizedtrust.splice.integration.tests.ScanConnectionIntegrationTest
2423
org.lfdecentralizedtrust.splice.integration.tests.ScanEventHistoryIntegrationTest
2524
org.lfdecentralizedtrust.splice.integration.tests.ScanHistoryBackfillingIntegrationTest
2625
org.lfdecentralizedtrust.splice.integration.tests.ScanIntegrationTest
2726
org.lfdecentralizedtrust.splice.integration.tests.ScanTxLogOwnerExpireLockIntegrationTest
27+
org.lfdecentralizedtrust.splice.integration.tests.SequencerPruningIntegrationTest
2828
org.lfdecentralizedtrust.splice.integration.tests.SplitwellIntegrationTest
2929
org.lfdecentralizedtrust.splice.integration.tests.SplitwellUpgradeIntegrationTest
3030
org.lfdecentralizedtrust.splice.integration.tests.SvDevNetReonboardingIntegrationTest

0 commit comments

Comments
 (0)