Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Add test for #4216
  • Loading branch information
wolfs committed Feb 1, 2018
commit 34864c3c658e39816b9dc3dcabc9e2a714446535
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ import org.gradle.integtests.fixtures.AbstractIntegrationSpec
import org.gradle.integtests.fixtures.BuildOperationsFixture
import org.gradle.integtests.fixtures.TestBuildCache
import org.gradle.internal.operations.trace.BuildOperationTrace
import org.gradle.util.ToBeImplemented
import spock.lang.Issue

/**
* Tests build cache configuration within composite builds and buildSrc.
*/
Expand Down Expand Up @@ -110,6 +113,52 @@ class BuildCacheCompositeConfigurationIntegrationTest extends AbstractIntegratio
]
}

@ToBeImplemented
@Issue("https://github.com/gradle/gradle/issues/4216")
def "build cache service is closed only after all included builds are finished"() {
def localCache = new TestBuildCache(file("local-cache"))

buildTestFixture.withBuildInSubDir()
['i1', 'i2'].each {
multiProjectBuild(it, ['first', 'second']) {
buildFile << """
gradle.startParameter.setTaskNames(['build'])
println gradle
allprojects {
apply plugin: 'java-library'
}
"""
}
}

settingsFile << localCache.localCacheConfiguration() << """
includeBuild "i1"
includeBuild "i2"
"""
buildFile << """
apply plugin: 'java'
println gradle
gradle.startParameter.setTaskNames(['build'])
processResources {
dependsOn gradle.includedBuild('i1').task(':processResources')
dependsOn gradle.includedBuild('i2').task(':processResources')
}
"""

expect:
withBuildCache().succeeds '--parallel'

when:
['i1', 'i2'].each {
file("$it/src/test/java/DummyTest.java") << "public class DummyTest {}"
}
then:
executer.withStackTraceChecksDisabled() // FIXME: There should be no stack traces
withBuildCache().succeeds '--parallel'
output.contains('Failed to store cache entry')
output.contains('NullPointerException')
}

private static String customTaskCode(String val = "foo") {
"""
@CacheableTask
Expand Down