Test: Upgrade randomized runner to 2.5.0 (#23513)

This commit upgrades to the newest version of randomized runner. There
is a new additional check that allows ensuring the working directory
for each child jvm is empty. By default, this check will fail the test
run. However, for elasticsearch, we default to wipe the directory. For
example, if you previously told the runner to not wipe the directory, in
order to investigate a failure, the wipe option will delete this data
upon re-running the test.
This commit is contained in:
Ryan Ernst 2017-03-09 11:56:43 -08:00 committed by GitHub
parent e3b1c95623
commit 9488985775
4 changed files with 8 additions and 2 deletions

View File

@ -67,6 +67,10 @@ class RandomizedTestingTask extends DefaultTask implements ProgressLoggerFactory
@Input
String ifNoTests = 'ignore'
@Optional
@Input
String onNonEmptyWorkDirectory = 'fail'
TestLoggingConfiguration testLoggingConfig = new TestLoggingConfiguration()
BalancersConfiguration balancersConfig = new BalancersConfiguration(task: this)
@ -193,6 +197,7 @@ class RandomizedTestingTask extends DefaultTask implements ProgressLoggerFactory
shuffleOnSlave: shuffleOnSlave,
leaveTemporary: leaveTemporary,
ifNoTests: ifNoTests,
onNonEmptyWorkDirectory: onNonEmptyWorkDirectory,
newenvironment: true
]

View File

@ -476,6 +476,7 @@ class BuildPlugin implements Plugin<Project> {
jvm "${project.javaHome}/bin/java"
parallelism System.getProperty('tests.jvms', 'auto')
ifNoTests 'fail'
onNonEmptyWorkDirectory 'wipe'
leaveTemporary true
// TODO: why are we not passing maxmemory to junit4?

View File

@ -13,7 +13,7 @@ slf4j = 1.6.2
jna = 4.2.2
# test dependencies
randomizedrunner = 2.4.0
randomizedrunner = 2.5.0
junit = 4.11
httpclient = 4.5.2
# When updating httpcore, please also update core/src/main/resources/org/elasticsearch/bootstrap/test-framework.policy

View File

@ -42,7 +42,7 @@ grant codeBase "${codebase.lucene-test-framework-6.5.0-snapshot-d00c5ca.jar}" {
permission java.lang.RuntimePermission "accessDeclaredMembers";
};
grant codeBase "${codebase.randomizedtesting-runner-2.4.0.jar}" {
grant codeBase "${codebase.randomizedtesting-runner-2.5.0.jar}" {
// optionally needed for access to private test methods (e.g. beforeClass)
permission java.lang.reflect.ReflectPermission "suppressAccessChecks";
// needed to fail tests on uncaught exceptions from other threads