Only use -Dtests.jvm.argline instead of numbered options

This commit is contained in:
Simon Willnauer 2013-11-26 11:00:28 +01:00
parent 9b839ca79f
commit cf3ba7c51c
3 changed files with 12 additions and 42 deletions

View File

@ -48,18 +48,21 @@ def get_random_one(data_array)
data_array[rand(data_array.size)]
end
# given a jdk directory selection, generate revelant environment variables
# given a jdk directory selection, generate relevant environment variables
def get_env_matrix(data_array)
#refactoring target
es_test_jvm_option1 = get_random_one(['-client', '-server'])
es_test_jvm_option2 = get_random_one(['-XX:+UseConcMarkSweepGC', '-XX:+UseParallelGC', '-XX:+UseSerialGC',
'-XX:+UseG1GC'])
es_test_jvm_option1 = get_random_one(['-server']) #only server for now get_random_one(['-client', '-server'])
greater_than_six = File.basename([*data_array].first).split(/[^0-9]/)[-1].to_i > 6
es_test_jvm_option2 = greater_than_six ? get_random_one(['-XX:+UseConcMarkSweepGC', '-XX:+UseParallelGC', '-XX:+UseSerialGC',
'-XX:+UseG1GC']) :
get_random_one(['-XX:+UseConcMarkSweepGC', '-XX:+UseParallelGC', '-XX:+UseSerialGC'])
es_test_jvm_option3 = get_random_one(['-XX:+UseCompressedOops', '-XX:-UseCompressedOops'])
es_node_mode = get_random_one(['local', 'network'])
tests_nightly = get_random_one([true, false])
tests_nightly = get_random_one([false]) #bug
#build_desc = "%s,%s,%s%s %s %s"%[File.basename(x), es_node_mode, tests_nightly, es_test_jvm_option1, es_test_jvm_option2, es_test_jvm_option3]
[*data_array].map do |x|
{
'PATH' => File.join(x,'bin') + ':' + ENV['PATH'],
@ -68,9 +71,7 @@ def get_env_matrix(data_array)
es_test_jvm_option1[1..-1], es_test_jvm_option2[4..-1], es_test_jvm_option3[4..-1]],
'es.node.mode' => es_node_mode,
'tests.nightly' => tests_nightly,
'ES_TESTS_JVM_OPTION1' => es_test_jvm_option1,
'ES_TESTS_JVM_OPTION2' => es_test_jvm_option2,
'ES_TESTS_JVM_OPTION3' => es_test_jvm_option3,
'tests.jvm.argline' => "%s %s %s"%[es_test_jvm_option1, es_test_jvm_option2, es_test_jvm_option3]
}
end
end

13
pom.xml
View File

@ -36,10 +36,6 @@
<tests.output>onerror</tests.output>
<tests.client.ratio></tests.client.ratio>
<tests.jvm.argline></tests.jvm.argline>
<tests.jvm.option1>${env.ES_TESTS_JVM_OPTION1}</tests.jvm.option1>
<tests.jvm.option2>${env.ES_TESTS_JVM_OPTION2}</tests.jvm.option2>
<tests.jvm.option3>${env.ES_TESTS_JVM_OPTION3}</tests.jvm.option3>
<tests.jvm.option4>${env.ES_TESTS_JVM_OPTION4}</tests.jvm.option4>
<es.logger.level>INFO</es.logger.level>
</properties>
@ -374,10 +370,6 @@
${tests.jvm.argline}
</argLine>
<jvmArgs>
<param>${tests.jvm.option1}</param>
<param>${tests.jvm.option2}</param>
<param>${tests.jvm.option3}</param>
<param>${tests.jvm.option4}</param>
<param>-Xmx512m</param>
<param>-XX:MaxDirectMemorySize=512m</param>
<param>-Des.logger.prefix=</param>
@ -389,11 +381,6 @@
<systemProperties>
<!-- RandomizedTesting library system properties -->
<tests.jvm.argline>${tests.jvm.argline}</tests.jvm.argline>
<!-- the option[1..4] should go away soon once the jenkins skript if adjusted-->
<tests.jvm.option1>${tests.jvm.option1}</tests.jvm.option1>
<tests.jvm.option2>${tests.jvm.option2}</tests.jvm.option2>
<tests.jvm.option3>${tests.jvm.option3}</tests.jvm.option3>
<tests.jvm.option4>${tests.jvm.option4}</tests.jvm.option4>
<tests.iters>${tests.iters}</tests.iters>
<tests.maxfailures>${tests.maxfailures}</tests.maxfailures>
<tests.failfast>${tests.failfast}</tests.failfast>

View File

@ -74,7 +74,6 @@ public class ReproduceInfoPrinter extends RunListener {
@Override
public ReproduceErrorMessageBuilder appendAllOpts(Description description) {
super.appendAllOpts(description);
appendJVMArgLine();
return appendESProperties();
}
@ -98,28 +97,11 @@ public class ReproduceInfoPrinter extends RunListener {
appendOpt(sysPropName, System.getProperty(sysPropName));
}
}
if (System.getProperty("tests.jvm.argline") != null && !System.getProperty("tests.jvm.argline").isEmpty()) {
appendOpt("tests.jvm.argline", "\"" + System.getProperty("tests.jvm.argline") + "\"");
}
return this;
}
public ReproduceErrorMessageBuilder appendJVMArgLine() {
StringBuilder builder = new StringBuilder();
Set<String> values = new HashSet<String>();
for (String sysPropName : Arrays.asList(
"tests.jvm.option1", "tests.jvm.option2", "tests.jvm.option3", "tests.jvm.option4", "tests.jvm.argline")) {
if (System.getProperty(sysPropName) != null && !System.getProperty(sysPropName).isEmpty()) {
String propValue = System.getProperty(sysPropName).trim();
if (!values.contains(propValue)) {
builder.append(propValue);
values.add(propValue); // deduplicate
builder.append(' ');
}
}
}
if (builder.length() > 0) {
appendOpt("tests.jvm.argline", "\"" + builder.toString().trim() + "\"");
}
return this;
}
}
}