Skip to content

Commit 03e6184

Browse files
step through rounds more slowly in BigQuery test (#3309)
- try advanceTimeForRewardAutomationToRunForCurrentRound * lower tps * 30 seconds is meaningfully more reliable than 20 --------- Signed-off-by: Stephen Compall <stephen.compall@digitalasset.com>
1 parent f7b28ce commit 03e6184

File tree

1 file changed

+22
-26
lines changed

1 file changed

+22
-26
lines changed

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

Lines changed: 22 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,9 @@ class ScanTotalSupplyBigQueryIntegrationTest
8686
// The test currently produces 80 transactions, which is 0.000926 tps over 24 hours,
8787
// so we assert for a range of 70-85 transactions, or 0.0008-0.00099 tps.
8888
private val avgTps = (0.0008, 0.00099)
89-
// The peak is 22 transactions in a (simulated) minute, or 0.36667 tps over a minute,
90-
// so we assert 19-25 transactions, or 0.31-0.42 tps
91-
private val peakTps = (0.31, 0.42)
89+
// The peak is 18 transactions in a (simulated) minute, or 0.3 tps over a minute,
90+
// so we assert 15-21 transactions, or 0.25-0.35 tps
91+
private val peakTps = (0.25, 0.35)
9292
private val totalRounds = 4
9393

9494
override def beforeAll() = {
@@ -295,30 +295,26 @@ class ScanTotalSupplyBigQueryIntegrationTest
295295
private def createTestData(bobParty: PartyId)(implicit
296296
env: FixtureParam
297297
): Unit = {
298-
actAndCheck(
299-
"step forward many rounds", {
300-
actAndCheck(
301-
"Advance the first round", {
302-
advanceRoundsToNextRoundOpening
303-
},
304-
)(
305-
"Wait for alice to report activity up to round 2",
306-
_ =>
307-
aliceValidatorWalletClient
308-
.listValidatorLivenessActivityRecords()
309-
.map(_.payload.round.number) should contain(2),
310-
)
311-
312-
(3 to 6).foreach { _ =>
298+
forAll(
299+
Table(
300+
("round", "expected balance"),
301+
(2, BigDecimal("0")),
302+
(3, BigDecimal("6512.93759512940")),
303+
(4, BigDecimal("13025.8751902588")),
304+
(5, BigDecimal("19538.8127853882")),
305+
(6, aliceValidatorMintedAmount),
306+
)
307+
) { (expectRound, expectedBalance) =>
308+
actAndCheck(timeUntilSuccess = 30.seconds)(
309+
s"Advance round ${expectRound - 1}", {
313310
advanceRoundsToNextRoundOpening
314-
}
315-
},
316-
)(
317-
"alice validator receives rewards",
318-
_ => {
319-
aliceValidatorWalletClient.balance().unlockedQty shouldBe aliceValidatorMintedAmount
320-
},
321-
)
311+
advanceTimeForRewardAutomationToRunForCurrentRound
312+
},
313+
)(
314+
s"alice validator receives rewards up to round $expectRound",
315+
_ => aliceValidatorWalletClient.balance().unlockedQty should be >= expectedBalance,
316+
)
317+
}
322318

323319
val aliceValidatorParty = aliceValidatorBackend.getValidatorPartyId()
324320
val (lockingParty, lockingClient) = (aliceValidatorParty, aliceValidatorWalletClient)

0 commit comments

Comments
 (0)