[BUILD] Randomize JVM heapsize between 512 and 1024m

This commit is contained in:
Simon Willnauer 2014-08-21 13:43:30 +02:00
parent 3b51342515
commit a9f42e7176
1 changed files with 8 additions and 1 deletions

View File

@ -57,6 +57,7 @@ RANDOM_CHOICES = {
# bug forced to be false for now :test_nightly => { :method => :true_or_false},
'tests.nightly' => {:selections => false},
'tests.heap.size' => {:choices => [512, 1024], :method => :random_heap},
'tests.assertion.disabled'=> {:choices => 'org.elasticsearch', :method => 'get_10_percent'},
'tests.security.manager' => {:choices => [true, false], :method => 'get_90_percent'},
}
@ -94,6 +95,11 @@ class Randomizer
[true, false][rand(2)]
end
def random_heap
inner_data_array = [data_array[0], data_array[1], data_array[0] + rand(data_array[1] - data_array[0])]
"%sm" % inner_data_array[rand(inner_data_array.size)]
end
def get_random_with_distribution(mdata_array, distribution)
L.debug "randomized distribution data %s" % YAML.dump(mdata_array)
L.debug "randomized distribution distribution %s" % YAML.dump(distribution)
@ -288,9 +294,10 @@ class RandomizedRunner
desc = {}
# TODO: better error handling
desc[:BUILD_DESC] = "%s,%s,%s%s%s%s" % [
desc[:BUILD_DESC] = "%s,%s,heap[%s],%s%s%s%s" % [
File.basename(j[:JAVA_HOME]),
s['es.node.mode'],
s['tests.heap.size'],
s['tests.nightly'] ? 'nightly,':'',
s['tests.jvm.argline'].gsub(/-XX:/,''),
s.has_key?('tests.assertion.disabled')? ',assert off' : '',