diff --git a/test/unit/org/apache/cassandra/cql3/PreparedStatementsTest.java b/test/unit/org/apache/cassandra/cql3/PreparedStatementsTest.java index d88507149f..c8688c1bc4 100644 --- a/test/unit/org/apache/cassandra/cql3/PreparedStatementsTest.java +++ b/test/unit/org/apache/cassandra/cql3/PreparedStatementsTest.java @@ -22,6 +22,7 @@ import java.util.stream.Collectors; import org.junit.Before; +import org.junit.BeforeClass; import org.junit.Test; import com.datastax.driver.core.Cluster; @@ -29,6 +30,7 @@ import com.datastax.driver.core.ResultSet; import com.datastax.driver.core.Session; import com.datastax.driver.core.exceptions.SyntaxError; +import org.apache.cassandra.config.DatabaseDescriptor; import org.apache.cassandra.db.ConsistencyLevel; import org.apache.cassandra.exceptions.PreparedQueryNotFoundException; import org.apache.cassandra.index.StubIndex; @@ -49,6 +51,18 @@ public class PreparedStatementsTest extends CQLTester " WITH REPLICATION = { 'class' : 'SimpleStrategy', 'replication_factor' : 1 };"; private static final String dropKsStatement = "DROP KEYSPACE IF EXISTS " + KEYSPACE; + + /** + * Prevent the {@link org.apache.cassandra.cql3.statements.schema.TuneUpReplicationFactor} from + * uptuning the replication factor to ensure that the test can reliably check the assertions. + */ + @BeforeClass + public static void setUpClass() + { + DatabaseDescriptor.setUptuningEnabled(false); + CQLTester.setUpClass(); + } + @Before public void setup() { diff --git a/test/unit/org/apache/cassandra/triggers/TriggersTest.java b/test/unit/org/apache/cassandra/triggers/TriggersTest.java index 2cf0e84ee4..80c87b6174 100644 --- a/test/unit/org/apache/cassandra/triggers/TriggersTest.java +++ b/test/unit/org/apache/cassandra/triggers/TriggersTest.java @@ -25,6 +25,7 @@ import org.junit.Test; import org.apache.cassandra.SchemaLoader; +import org.apache.cassandra.config.DatabaseDescriptor; import org.apache.cassandra.schema.Schema; import org.apache.cassandra.cql3.QueryProcessor; import org.apache.cassandra.cql3.UntypedResultSet; @@ -59,6 +60,7 @@ public static void beforeTest() throws ConfigurationException public void setup() throws Exception { StorageService.instance.initServer(0); + DatabaseDescriptor.setUptuningEnabled(false); String cql = String.format("CREATE KEYSPACE IF NOT EXISTS %s " + "WITH REPLICATION = {'class': 'SimpleStrategy', 'replication_factor': 1}",