Reduce probability of intermittent failures in WriteWarningsSnapshotTest

Patch by Minal Kyada; reviewed by Sam Tunnicliffe and Caleb Rackliffe
for CASSANDRA-21263
This commit is contained in:
Minal Kyada 2026-03-25 16:45:13 -07:00 committed by Sam Tunnicliffe
parent a657f4bef9
commit 4134d72a5a
1 changed files with 1 additions and 2 deletions

View File

@ -175,11 +175,10 @@ public class WriteWarningsSnapshotTest
private static Gen<WriteThresholdCounter> counter()
{
Gen<Boolean> isEmpty = SourceDSL.booleans().all();
Constraint maxValue = Constraint.between(1, Long.MAX_VALUE);
Gen<WriteThresholdCounter> gen = rs ->
{
if (isEmpty.generate(rs))
if (rs.next(Constraint.between(0, 3)) == 0)
return WriteThresholdCounter.empty();
Map<TableId, Long> values = new HashMap<>();
values.put(TABLE1, rs.next(maxValue));