mirror of https://github.com/apache/cassandra
Merge branch 'cassandra-3.0' into cassandra-3.11
This commit is contained in:
commit
cca5ce56ac
87
build.xml
87
build.xml
|
|
@ -1279,6 +1279,43 @@
|
||||||
</copy>
|
</copy>
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
|
<!-- Run tests separately and report errors after and generate a junit report -->
|
||||||
|
<macrodef name="testhelper">
|
||||||
|
<attribute name="testdelegate"/>
|
||||||
|
<sequential>
|
||||||
|
<testhelper_ testdelegate="@{testdelegate}"/>
|
||||||
|
<fail message="Some test(s) failed.">
|
||||||
|
<condition>
|
||||||
|
<and>
|
||||||
|
<isset property="testfailed"/>
|
||||||
|
<not>
|
||||||
|
<isset property="ant.test.failure.ignore"/>
|
||||||
|
</not>
|
||||||
|
</and>
|
||||||
|
</condition>
|
||||||
|
</fail>
|
||||||
|
</sequential>
|
||||||
|
</macrodef>
|
||||||
|
|
||||||
|
<!-- Run a list of junit tasks but don't track errors or generate a report after
|
||||||
|
If a test fails the testfailed property will be set. All the tests are run using the testdelegate
|
||||||
|
macro that is specified as an attribute and they will be run sequentially in this ant process -->
|
||||||
|
<scriptdef name="testhelper_" language="javascript">
|
||||||
|
<attribute name="testdelegate"/>
|
||||||
|
<![CDATA[
|
||||||
|
sep = project.getProperty("path.separator");
|
||||||
|
all = project.getProperty("all-test-classes").split(sep);
|
||||||
|
var p = project.createTask('sequential');
|
||||||
|
for (i = 0; i < all.length; i++) {
|
||||||
|
if (all[i] == undefined) continue;
|
||||||
|
task = project.createTask( attributes.get("testdelegate") );
|
||||||
|
task.setDynamicAttribute( "test.file.list", "" + all[i]);
|
||||||
|
p.addTask(task);
|
||||||
|
}
|
||||||
|
p.perform();
|
||||||
|
]]>
|
||||||
|
</scriptdef>
|
||||||
|
|
||||||
<!-- Defines how to run a set of tests. If you change the defaults for attributes
|
<!-- Defines how to run a set of tests. If you change the defaults for attributes
|
||||||
you should also update them in testmacro.,
|
you should also update them in testmacro.,
|
||||||
The two are split because the helper doesn't generate
|
The two are split because the helper doesn't generate
|
||||||
|
|
@ -1291,7 +1328,6 @@
|
||||||
<attribute name="filter" default="**/${test.name}.java"/>
|
<attribute name="filter" default="**/${test.name}.java"/>
|
||||||
<attribute name="exclude" default="" />
|
<attribute name="exclude" default="" />
|
||||||
<attribute name="filelist" default="" />
|
<attribute name="filelist" default="" />
|
||||||
<attribute name="poffset" default="0"/>
|
|
||||||
<attribute name="testtag" default=""/>
|
<attribute name="testtag" default=""/>
|
||||||
<attribute name="usejacoco" default="no"/>
|
<attribute name="usejacoco" default="no"/>
|
||||||
<attribute name="showoutput" default="false"/>
|
<attribute name="showoutput" default="false"/>
|
||||||
|
|
@ -1327,7 +1363,6 @@
|
||||||
<jvmarg value="-XX:SoftRefLRUPolicyMSPerMB=0" />
|
<jvmarg value="-XX:SoftRefLRUPolicyMSPerMB=0" />
|
||||||
<jvmarg value="-Dcassandra.memtable_row_overhead_computation_step=100"/>
|
<jvmarg value="-Dcassandra.memtable_row_overhead_computation_step=100"/>
|
||||||
<jvmarg value="-Dcassandra.test.use_prepared=${cassandra.test.use_prepared}"/>
|
<jvmarg value="-Dcassandra.test.use_prepared=${cassandra.test.use_prepared}"/>
|
||||||
<jvmarg value="-Dcassandra.test.offsetseed=@{poffset}"/>
|
|
||||||
<jvmarg value="-Dcassandra.test.sstableformatdevelopment=true"/>
|
<jvmarg value="-Dcassandra.test.sstableformatdevelopment=true"/>
|
||||||
<!-- The first time SecureRandom initializes can be slow if it blocks on /dev/random -->
|
<!-- The first time SecureRandom initializes can be slow if it blocks on /dev/random -->
|
||||||
<jvmarg value="-Djava.security.egd=file:/dev/urandom" />
|
<jvmarg value="-Djava.security.egd=file:/dev/urandom" />
|
||||||
|
|
@ -1354,19 +1389,11 @@
|
||||||
</batchtest>
|
</batchtest>
|
||||||
</junit-timeout>
|
</junit-timeout>
|
||||||
|
|
||||||
<condition property="fileSep" value=";">
|
<delete quiet="true" failonerror="false" dir="${build.test.dir}/cassandra/commitlog"/>
|
||||||
<os family="windows"/>
|
<delete quiet="true" failonerror="false" dir="${build.test.dir}/cassandra/cdc_raw"/>
|
||||||
</condition>
|
<delete quiet="true" failonerror="false" dir="${build.test.dir}/cassandra/data"/>
|
||||||
<condition property="fileSep" else=":">
|
<delete quiet="true" failonerror="false" dir="${build.test.dir}/cassandra/saved_caches"/>
|
||||||
<isset property="fileSep"/>
|
<delete quiet="true" failonerror="false" dir="${build.test.dir}/cassandra/hints"/>
|
||||||
</condition>
|
|
||||||
<fail unless="fileSep">Failed to set File Separator. This shouldn't happen.</fail>
|
|
||||||
|
|
||||||
<delete quiet="true" failonerror="false" dir="${build.test.dir}/cassandra/commitlog${fileSep}@{poffset}"/>
|
|
||||||
<delete quiet="true" failonerror="false" dir="${build.test.dir}/cassandra/cdc_raw${fileSep}@{poffset}"/>
|
|
||||||
<delete quiet="true" failonerror="false" dir="${build.test.dir}/cassandra/data${fileSep}@{poffset}"/>
|
|
||||||
<delete quiet="true" failonerror="false" dir="${build.test.dir}/cassandra/saved_caches${fileSep}@{poffset}"/>
|
|
||||||
<delete quiet="true" failonerror="false" dir="${build.test.dir}/cassandra/hints${fileSep}@{poffset}"/>
|
|
||||||
</sequential>
|
</sequential>
|
||||||
</macrodef>
|
</macrodef>
|
||||||
|
|
||||||
|
|
@ -1392,7 +1419,6 @@
|
||||||
<jvmarg value="-Dmigration-sstable-root=${test.data}/migration-sstables"/>
|
<jvmarg value="-Dmigration-sstable-root=${test.data}/migration-sstables"/>
|
||||||
<jvmarg value="-Dcassandra.ring_delay_ms=1000"/>
|
<jvmarg value="-Dcassandra.ring_delay_ms=1000"/>
|
||||||
<jvmarg value="-Dcassandra.tolerate_sstable_size=true"/>
|
<jvmarg value="-Dcassandra.tolerate_sstable_size=true"/>
|
||||||
<jvmarg value="-Dcassandra.config.loader=org.apache.cassandra.OffsetAwareConfigurationLoader"/>
|
|
||||||
<jvmarg value="-Dcassandra.skip_sync=true" />
|
<jvmarg value="-Dcassandra.skip_sync=true" />
|
||||||
</testmacrohelper>
|
</testmacrohelper>
|
||||||
</sequential>
|
</sequential>
|
||||||
|
|
@ -1417,7 +1443,6 @@
|
||||||
<jvmarg value="-Dcassandra.tolerate_sstable_size=true"/>
|
<jvmarg value="-Dcassandra.tolerate_sstable_size=true"/>
|
||||||
<jvmarg value="-Dcassandra.config=file:///${compressed_yaml}"/>
|
<jvmarg value="-Dcassandra.config=file:///${compressed_yaml}"/>
|
||||||
<jvmarg value="-Dcassandra.skip_sync=true" />
|
<jvmarg value="-Dcassandra.skip_sync=true" />
|
||||||
<jvmarg value="-Dcassandra.config.loader=org.apache.cassandra.OffsetAwareConfigurationLoader"/>
|
|
||||||
</testmacrohelper>
|
</testmacrohelper>
|
||||||
</sequential>
|
</sequential>
|
||||||
</macrodef>
|
</macrodef>
|
||||||
|
|
@ -1439,7 +1464,6 @@
|
||||||
<jvmarg value="-Dcassandra.tolerate_sstable_size=true"/>
|
<jvmarg value="-Dcassandra.tolerate_sstable_size=true"/>
|
||||||
<jvmarg value="-Dcassandra.config=file:///${cdc_yaml}"/>
|
<jvmarg value="-Dcassandra.config=file:///${cdc_yaml}"/>
|
||||||
<jvmarg value="-Dcassandra.skip_sync=true" />
|
<jvmarg value="-Dcassandra.skip_sync=true" />
|
||||||
<jvmarg value="-Dcassandra.config.loader=org.apache.cassandra.OffsetAwareConfigurationLoader"/>
|
|
||||||
</testmacrohelper>
|
</testmacrohelper>
|
||||||
</sequential>
|
</sequential>
|
||||||
</macrodef>
|
</macrodef>
|
||||||
|
|
@ -1484,16 +1508,16 @@
|
||||||
<fileset dir="${test.unit.src}" includes="**/${test.name}.java" />
|
<fileset dir="${test.unit.src}" includes="**/${test.name}.java" />
|
||||||
<fileset dir="${test.distributed.src}" includes="**/${test.name}.java" />
|
<fileset dir="${test.distributed.src}" includes="**/${test.name}.java" />
|
||||||
</path>
|
</path>
|
||||||
<property name="test.file.list" refid="all-test-classes-path"/>
|
<property name="all-test-classes" refid="all-test-classes-path"/>
|
||||||
<testlist-compression test.file.list="${test.file.list}"/>
|
<testhelper testdelegate="testlist-compression" />
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
<target name="test-cdc" depends="build-test" description="Execute unit tests with change-data-capture enabled">
|
<target name="test-cdc" depends="build-test" description="Execute unit tests with change-data-capture enabled">
|
||||||
<path id="all-test-classes-path">
|
<path id="all-test-classes-path">
|
||||||
<fileset dir="${test.unit.src}" includes="**/${test.name}.java" />
|
<fileset dir="${test.unit.src}" includes="**/${test.name}.java" />
|
||||||
</path>
|
</path>
|
||||||
<property name="test.file.list" refid="all-test-classes-path"/>
|
<property name="all-test-classes" refid="all-test-classes-path"/>
|
||||||
<testlist-cdc test.file.list="${test.file.list}"/>
|
<testhelper testdelegate="testlist-cdc" />
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
<target name="msg-ser-gen-test" depends="build-test" description="Generates message serializations">
|
<target name="msg-ser-gen-test" depends="build-test" description="Generates message serializations">
|
||||||
|
|
@ -1709,13 +1733,12 @@
|
||||||
<attribute name="filter" default="**/${test.name}.java"/>
|
<attribute name="filter" default="**/${test.name}.java"/>
|
||||||
<attribute name="exclude" default="" />
|
<attribute name="exclude" default="" />
|
||||||
<attribute name="filelist" default="" />
|
<attribute name="filelist" default="" />
|
||||||
<attribute name="poffset" default="0"/>
|
|
||||||
<attribute name="testtag" default=""/>
|
<attribute name="testtag" default=""/>
|
||||||
|
|
||||||
<sequential>
|
<sequential>
|
||||||
<testmacrohelper inputdir="@{inputdir}" timeout="@{timeout}"
|
<testmacrohelper inputdir="@{inputdir}" timeout="@{timeout}"
|
||||||
forkmode="@{forkmode}" filter="@{filter}"
|
forkmode="@{forkmode}" filter="@{filter}"
|
||||||
exclude="@{exclude}" filelist="@{filelist}" poffset="@{poffset}"
|
exclude="@{exclude}" filelist="@{filelist}"
|
||||||
testtag="@{testtag}" showoutput="false" >
|
testtag="@{testtag}" showoutput="false" >
|
||||||
<optjvmargs/>
|
<optjvmargs/>
|
||||||
</testmacrohelper>
|
</testmacrohelper>
|
||||||
|
|
@ -1736,8 +1759,8 @@
|
||||||
<path id="all-test-classes-path">
|
<path id="all-test-classes-path">
|
||||||
<fileset dir="${test.unit.src}" includes="**/${test.name}.java" excludes="**/distributed/test/UpgradeTest*.java" />
|
<fileset dir="${test.unit.src}" includes="**/${test.name}.java" excludes="**/distributed/test/UpgradeTest*.java" />
|
||||||
</path>
|
</path>
|
||||||
<property name="test.file.list" refid="all-test-classes-path"/>
|
<property name="all-test-classes" refid="all-test-classes-path"/>
|
||||||
<testlist test.file.list="${test.file.list}"/>
|
<testhelper testdelegate="testlist"/>
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
<target name="generate-test-report" description="Generates JUnit's HTML report from results already in build/output">
|
<target name="generate-test-report" description="Generates JUnit's HTML report from results already in build/output">
|
||||||
|
|
@ -1756,24 +1779,24 @@
|
||||||
<path id="all-test-classes-path">
|
<path id="all-test-classes-path">
|
||||||
<fileset dir="${test.dir}/${test.classlistprefix}" includesfile="${test.classlistfile}"/>
|
<fileset dir="${test.dir}/${test.classlistprefix}" includesfile="${test.classlistfile}"/>
|
||||||
</path>
|
</path>
|
||||||
<property name="test.file.list" refid="all-test-classes-path"/>
|
<property name="all-test-classes" refid="all-test-classes-path"/>
|
||||||
<testlist test.file.list="${test.file.list}"/>
|
<testhelper testdelegate="testlist"/>
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
<target name="testclasslist-compression" depends="build-test" description="Run tests given in file -Dtest.classlistfile (one-class-per-line, e.g. org/apache/cassandra/db/SomeTest.java)">
|
<target name="testclasslist-compression" depends="build-test" description="Run tests given in file -Dtest.classlistfile (one-class-per-line, e.g. org/apache/cassandra/db/SomeTest.java)">
|
||||||
<path id="all-test-classes-path">
|
<path id="all-test-classes-path">
|
||||||
<fileset dir="${test.dir}/${test.classlistprefix}" includesfile="${test.classlistfile}"/>
|
<fileset dir="${test.dir}/${test.classlistprefix}" includesfile="${test.classlistfile}"/>
|
||||||
</path>
|
</path>
|
||||||
<property name="test.file.list" refid="all-test-classes-path"/>
|
<property name="all-test-classes" refid="all-test-classes-path"/>
|
||||||
<testlist-compression test.file.list="${test.file.list}"/>
|
<testhelper testdelegate="testlist-compression"/>
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
<target name="testclasslist-cdc" depends="build-test" description="Run tests given in file -Dtest.classlistfile (one-class-per-line, e.g. org/apache/cassandra/db/SomeTest.java)">
|
<target name="testclasslist-cdc" depends="build-test" description="Run tests given in file -Dtest.classlistfile (one-class-per-line, e.g. org/apache/cassandra/db/SomeTest.java)">
|
||||||
<path id="all-test-classes-path">
|
<path id="all-test-classes-path">
|
||||||
<fileset dir="${test.dir}/${test.classlistprefix}" includesfile="${test.classlistfile}"/>
|
<fileset dir="${test.dir}/${test.classlistprefix}" includesfile="${test.classlistfile}"/>
|
||||||
</path>
|
</path>
|
||||||
<property name="test.file.list" refid="all-test-classes-path"/>
|
<property name="all-test-classes" refid="all-test-classes-path"/>
|
||||||
<testlist-cdc test.file.list="${test.file.list}"/>
|
<testhelper testdelegate="testlist-cdc"/>
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
<target name="dtest-jar" depends="build-test, build" description="Create dtest-compatible jar, including all dependencies">
|
<target name="dtest-jar" depends="build-test, build" description="Create dtest-compatible jar, including all dependencies">
|
||||||
|
|
|
||||||
|
|
@ -1,67 +0,0 @@
|
||||||
/**
|
|
||||||
* 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
|
|
||||||
* <p/>
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
* <p/>
|
|
||||||
* 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;
|
|
||||||
|
|
||||||
import org.apache.cassandra.config.Config;
|
|
||||||
import org.apache.cassandra.config.YamlConfigurationLoader;
|
|
||||||
import org.apache.cassandra.exceptions.ConfigurationException;
|
|
||||||
|
|
||||||
import java.io.File;
|
|
||||||
|
|
||||||
|
|
||||||
public class OffsetAwareConfigurationLoader extends YamlConfigurationLoader
|
|
||||||
{
|
|
||||||
|
|
||||||
static final String OFFSET_PROPERTY = "cassandra.test.offsetseed";
|
|
||||||
int offset = 0;
|
|
||||||
|
|
||||||
public OffsetAwareConfigurationLoader()
|
|
||||||
{
|
|
||||||
String offsetStr = System.getProperty(OFFSET_PROPERTY);
|
|
||||||
|
|
||||||
if (offsetStr == null)
|
|
||||||
throw new RuntimeException("offset property is not set: "+OFFSET_PROPERTY);
|
|
||||||
|
|
||||||
offset = Integer.valueOf(offsetStr);
|
|
||||||
|
|
||||||
assert offset >= 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Config loadConfig() throws ConfigurationException
|
|
||||||
{
|
|
||||||
Config config = super.loadConfig();
|
|
||||||
|
|
||||||
String sep = File.pathSeparator;
|
|
||||||
|
|
||||||
config.rpc_port += offset;
|
|
||||||
config.native_transport_port += offset;
|
|
||||||
config.storage_port += offset;
|
|
||||||
|
|
||||||
config.commitlog_directory += sep + offset;
|
|
||||||
config.saved_caches_directory += sep + offset;
|
|
||||||
config.hints_directory += sep + offset;
|
|
||||||
|
|
||||||
config.cdc_raw_directory += sep + offset;
|
|
||||||
|
|
||||||
for (int i = 0; i < config.data_file_directories.length; i++)
|
|
||||||
config.data_file_directories[i] += sep + offset;
|
|
||||||
|
|
||||||
return config;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -125,7 +125,6 @@ public class DatabaseDescriptorRefTest
|
||||||
"org.apache.cassandra.utils.FBUtilities$1",
|
"org.apache.cassandra.utils.FBUtilities$1",
|
||||||
"org.apache.cassandra.utils.CloseableIterator",
|
"org.apache.cassandra.utils.CloseableIterator",
|
||||||
"org.apache.cassandra.utils.Pair",
|
"org.apache.cassandra.utils.Pair",
|
||||||
"org.apache.cassandra.OffsetAwareConfigurationLoader",
|
|
||||||
"org.apache.cassandra.ConsoleAppender",
|
"org.apache.cassandra.ConsoleAppender",
|
||||||
"org.apache.cassandra.ConsoleAppender$1",
|
"org.apache.cassandra.ConsoleAppender$1",
|
||||||
"org.apache.cassandra.LogbackStatusListener",
|
"org.apache.cassandra.LogbackStatusListener",
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue