Reduce time the tests run to avoid timeouts

Patch by Alex Petrov; reviewed by Marcus Eriksson for CASSANDRA-19123
This commit is contained in:
Alex Petrov 2023-11-30 10:33:06 +01:00
parent 179711eab6
commit a98a5a1d9d
8 changed files with 72 additions and 21 deletions

View File

@ -42,7 +42,7 @@ import static org.apache.cassandra.distributed.shared.AssertUtils.row;
* See CASSANDRA-15924.
*/
@RunWith(Parameterized.class)
public class ReadRepairEmptyRangeTombstonesTest extends TestBaseImpl
public abstract class ReadRepairEmptyRangeTombstonesTestBase extends TestBaseImpl
{
private static final int NUM_NODES = 2;
@ -58,39 +58,34 @@ public class ReadRepairEmptyRangeTombstonesTest extends TestBaseImpl
@Parameterized.Parameter(1)
public int coordinator;
/**
* Whether to flush data after mutations
*/
@Parameterized.Parameter(2)
public boolean flush;
/**
* Whether paging is used for the distributed queries
*/
@Parameterized.Parameter(3)
@Parameterized.Parameter(2)
public boolean paging;
/**
* Whether the clustering order is reverse
*/
@Parameterized.Parameter(4)
@Parameterized.Parameter(3)
public boolean reverse;
@Parameterized.Parameters(name = "{index}: strategy={0} coordinator={1} flush={2} paging={3} reverse={4}")
@Parameterized.Parameters(name = "{index}: strategy={0} coordinator={1} paging={2} reverse={3}")
public static Collection<Object[]> data()
{
List<Object[]> result = new ArrayList<>();
for (int coordinator = 1; coordinator <= NUM_NODES; coordinator++)
for (boolean flush : BOOLEANS)
for (boolean paging : BOOLEANS)
for (boolean reverse : BOOLEANS)
result.add(new Object[]{ ReadRepairStrategy.BLOCKING, coordinator, flush, paging, reverse });
result.add(new Object[]{ ReadRepairStrategy.NONE, 1, false, false, false });
for (boolean paging : BOOLEANS)
for (boolean reverse : BOOLEANS)
result.add(new Object[]{ ReadRepairStrategy.BLOCKING, coordinator, paging, reverse });
result.add(new Object[]{ ReadRepairStrategy.NONE, 1, false, false });
return result;
}
private static Cluster cluster;
protected abstract boolean flush();
@BeforeClass
public static void setupCluster() throws IOException
{
@ -255,7 +250,7 @@ public class ReadRepairEmptyRangeTombstonesTest extends TestBaseImpl
private Tester tester()
{
return new Tester(cluster, strategy, coordinator, flush, paging, reverse);
return new Tester(cluster, strategy, coordinator, flush(), paging, reverse);
}
private static class Tester extends ReadRepairTester<Tester>

View File

@ -0,0 +1,28 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.cassandra.distributed.test;
public class ReadRepairEmptyRangeTombstonesWithFlushesTest extends ReadRepairEmptyRangeTombstonesTestBase
{
@Override
protected boolean flush()
{
return true;
}
}

View File

@ -0,0 +1,28 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.cassandra.distributed.test;
public class ReadRepairEmptyRangeTombstonesWithoutFlushesTest extends ReadRepairEmptyRangeTombstonesTestBase
{
@Override
protected boolean flush()
{
return false;
}
}

View File

@ -56,7 +56,7 @@ import static org.junit.Assert.assertFalse;
public class ConsistentLeaveTest extends FuzzTestBase
{
private static int WRITES = 2000;
private static int WRITES = 500;
@Test
public void decommissionTest() throws Throwable

View File

@ -59,7 +59,7 @@ import static org.junit.Assert.assertTrue;
public class ConsistentMoveTest extends FuzzTestBase
{
private static int WRITES = 2000;
private static int WRITES = 500;
@Test
public void moveTest() throws Throwable

View File

@ -63,7 +63,7 @@ import static org.apache.cassandra.distributed.shared.ClusterUtils.getSequenceAf
public class FailedLeaveTest extends FuzzTestBase
{
private static int WRITES = 2000;
private static int WRITES = 500;
@Test
public void resumeDecommissionWithStreamingFailureTest() throws Throwable

View File

@ -52,7 +52,7 @@ import static org.apache.cassandra.distributed.shared.ClusterUtils.getSequenceAf
public class ResumableStartupTest extends FuzzTestBase
{
private static int WRITES = 2000;
private static int WRITES = 500;
@Test
public void bootstrapWithDeferredJoinTest() throws Throwable

View File

@ -53,7 +53,7 @@ import static org.apache.cassandra.distributed.shared.ClusterUtils.waitForCMSToQ
public class ConsistentBootstrapTest extends FuzzTestBase
{
private static int WRITES = 2000;
private static int WRITES = 500;
private static final Configuration.ConfigurationBuilder configBuilder;