Skip to content

Commit

Permalink
GEODE-5035: Explicitly pass java.io.tmpdir to JVMs invoked by Gradle. (
Browse files Browse the repository at this point in the history
…apache#1779)

- Exclude distributed tests from using java.io.tmpdir as they appear
  to need /tmp.
  • Loading branch information
PivotalSarge authored Apr 13, 2018
1 parent f984c95 commit 130ed6e
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions gradle/test.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ subprojects {
useJUnit {
includeCategories 'org.apache.geode.test.junit.categories.UnitTest'
}

doFirst {
TestPropertiesWriter.writeTestProperties(buildDir, name)
}
Expand All @@ -122,20 +122,20 @@ subprojects {
TestPropertiesWriter.writeTestProperties(buildDir, name)
}
}

task distributedTest(type:Test) {
useJUnit {
includeCategories 'org.apache.geode.test.junit.categories.DistributedTest'
excludeCategories 'org.apache.geode.test.junit.categories.FlakyTest'
}
forkEvery 1
}

task flakyTest(type:Test) {
useJUnit {
includeCategories 'org.apache.geode.test.junit.categories.FlakyTest'
}

forkEvery 1
doFirst {
TestPropertiesWriter.writeTestProperties(buildDir, name)
Expand Down Expand Up @@ -345,15 +345,15 @@ subprojects {
//force tests to be run every time by
//saying the results are never up to date
outputs.upToDateWhen { false }

def resultsDir = TestPropertiesWriter.testResultsDir(buildDir, test.name)
workingDir resultsDir.absolutePath

reports.html.destination = file "$buildDir/reports/$name"
testLogging {
exceptionFormat = 'full'
}

maxHeapSize '768m'
// jvmArgs = ['-XX:+HeapDumpOnOutOfMemoryError', '-ea',"-XX:+PrintGC", "-XX:+PrintGCDetails","-XX:+PrintGCTimeStamps"]
jvmArgs = ['-XX:+HeapDumpOnOutOfMemoryError', '-ea']
Expand All @@ -373,6 +373,12 @@ subprojects {
systemProperty 'log4j.configurationFile', log4jLocation
}

// The distributed tests seem to need to use /tmp directly,
// so exclude them from using the supplied temp directory.
if (! test.name.contains("distributed")) {
systemProperty 'java.io.tmpdir', System.getProperty('java.io.tmpdir')
}

def eol = System.getProperty('line.separator')
def progress = new File(resultsDir, "$test.name-progress.txt")
beforeTest { desc ->
Expand Down

0 comments on commit 130ed6e

Please sign in to comment.