Skip to content

Commit 4134d72

Browse files
minal-kyadabeobal
authored andcommitted
Reduce probability of intermittent failures in WriteWarningsSnapshotTest
Patch by Minal Kyada; reviewed by Sam Tunnicliffe and Caleb Rackliffe for CASSANDRA-21263
1 parent a657f4b commit 4134d72

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

test/unit/org/apache/cassandra/service/writes/thresholds/WriteWarningsSnapshotTest.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,11 +175,10 @@ private static Gen<WriteWarningsSnapshot> nonEmpty()
175175

176176
private static Gen<WriteThresholdCounter> counter()
177177
{
178-
Gen<Boolean> isEmpty = SourceDSL.booleans().all();
179178
Constraint maxValue = Constraint.between(1, Long.MAX_VALUE);
180179
Gen<WriteThresholdCounter> gen = rs ->
181180
{
182-
if (isEmpty.generate(rs))
181+
if (rs.next(Constraint.between(0, 3)) == 0)
183182
return WriteThresholdCounter.empty();
184183
Map<TableId, Long> values = new HashMap<>();
185184
values.put(TABLE1, rs.next(maxValue));

0 commit comments

Comments
 (0)