ClassLoadersCachingIntegrationTest.groovy

Clone Tools
  • last updated a few seconds ago
Constraints
Constraints: committers
 
Constraints: files
Constraints: dates
Revert "Revert " Invalidate instant execution cache upon changes to the init script sequence""

    • -1
    • +0
    ./ClassLoadersCachingIntegrationTest.groovy
  1. … 8 more files in changeset.
Revert " Invalidate instant execution cache upon changes to the init script sequence"

    • -0
    • +1
    ./ClassLoadersCachingIntegrationTest.groovy
  1. … 8 more files in changeset.
Remove `@ToBeFixedForInstantExecution` from `ClassLoadersCachingIntegrationTest`

    • -1
    • +0
    ./ClassLoadersCachingIntegrationTest.groovy
Fixes.

    • -2
    • +4
    ./ClassLoadersCachingIntegrationTest.groovy
Fixes.

    • -2
    • +4
    ./ClassLoadersCachingIntegrationTest.groovy
Fixes.

    • -2
    • +4
    ./ClassLoadersCachingIntegrationTest.groovy
Extract some logic for Jar generation and reuse it to transform the Jars and directories found in the buildsrc and plugin classpaths.

In this commit, the transformation does not do anything. It just unpacks and recreates the Jar. Later commits will do some decoration of the classes.

    • -2
    • +4
    ./ClassLoadersCachingIntegrationTest.groovy
  1. … 12 more files in changeset.
Extract some logic for Jar generation and reuse it to transform the Jars and directories found in the buildsrc and plugin classpaths.

In this commit, the transformation does not do anything. It just unpacks and recreates the Jar. Later commits will do some decoration of the classes.

    • -2
    • +4
    ./ClassLoadersCachingIntegrationTest.groovy
  1. … 12 more files in changeset.
Remove `@ToBeFixedForInstantExecution` from `ClassLoadersCachingIntegrationTest`

    • -1
    • +0
    ./ClassLoadersCachingIntegrationTest.groovy
Rename @FailsWithInstantExecution to @ToBeFixedForInstantExecution

Signed-off-by: Paul Merlin <paul@gradle.com>

    • -14
    • +14
    ./ClassLoadersCachingIntegrationTest.groovy
  1. … 872 more files in changeset.
Annotate integ tests failing with instant execution in :core

Signed-off-by: Paul Merlin <paul@gradle.com>

    • -1
    • +14
    ./ClassLoadersCachingIntegrationTest.groovy
  1. … 99 more files in changeset.
Annotate integ tests failing with instant execution in :core

Signed-off-by: Paul Merlin <paul@gradle.com>

    • -1
    • +14
    ./ClassLoadersCachingIntegrationTest.groovy
  1. … 99 more files in changeset.
Annotate integ tests failing with instant execution in :core

Signed-off-by: Paul Merlin <paul@gradle.com>

    • -1
    • +14
    ./ClassLoadersCachingIntegrationTest.groovy
  1. … 100 more files in changeset.
Cleanup unused classloaders

Until now our classloader cache would only ever remove a classlaoder

if it was replaced by another one with the same ID. This works fine

if the daemon is used to build only one project. However, it becomes

a serious memory leak if the daemon builds many different projects.

This is a common scenario in Gradle integration tests, both in our

own code base and for users testing their plugins with TestKit.

In those cases the same daemon is used to build many different projects

and the JVM can eventually run out of metaspace.

This change adjusts the classloader cache so that it only retains

classloaders which were used either in the current build or the

previous build. All older unused classloaders are discarded to free

up memory.

    • -168
    • +1
    ./ClassLoadersCachingIntegrationTest.groovy
  1. … 7 more files in changeset.
Use runtime classpath snapshotting for classloader hashing

Previously classloaders were hashed via a custom snapshotter, which were not getting the goodness we were adding to regular runtime classpath snapshotting. Now we use the same implementation for both purposes.

+review REVIEW-6449

    • -9
    • +11
    ./ClassLoadersCachingIntegrationTest.groovy
  1. … 20 more files in changeset.
Minor tweak.

    • -17
    • +3
    ./ClassLoadersCachingIntegrationTest.groovy
Cleanup some LeaksFileHandles instances fixed by buildSrc classloader changes

+review REVIEW-6182

    • -2
    • +0
    ./ClassLoadersCachingIntegrationTest.groovy
  1. … 14 more files in changeset.
Change buildscript classpath to use cached jars instead of originals

+review REVIEW-6182

    • -3
    • +3
    ./ClassLoadersCachingIntegrationTest.groovy
  1. … 17 more files in changeset.
Fixed package cycle in integration test fixtures

    • -1
    • +1
    ./ClassLoadersCachingIntegrationTest.groovy
  1. … 3 more files in changeset.
Add cross-build script caching

    • -1
    • +11
    ./ClassLoadersCachingIntegrationTest.groovy
  1. … 6 more files in changeset.
More leaks file handles.

    • -0
    • +2
    ./ClassLoadersCachingIntegrationTest.groovy
Changed DefaultScriptRunnerFactory so that it does not instantiate or run scripts that are empty. Also short-circuits logging set up when script is empty.

    • -1
    • +24
    ./ClassLoadersCachingIntegrationTest.groovy
  1. … 4 more files in changeset.
Introduce a base class for tests that test cross build behaviour with a persistent build process.

    • -8
    • +3
    ./ClassLoadersCachingIntegrationTest.groovy
  1. … 2 more files in changeset.
Correct test now that we do a better job of releasing class loaders.

+review REVIEW-5411

    • -2
    • +2
    ./ClassLoadersCachingIntegrationTest.groovy
Release no longer needed script runtime classloaders.

+review REVIEW-5411

    • -2
    • +1
    ./ClassLoadersCachingIntegrationTest.groovy
  1. … 23 more files in changeset.
Add some extra verification that that internal class loader cache state makes sense.

+review REVIEW-5411

    • -1
    • +5
    ./ClassLoadersCachingIntegrationTest.groovy
  1. … 1 more file in changeset.
Isolate test from previous tests.

+review REVIEW-5411

    • -0
    • +8
    ./ClassLoadersCachingIntegrationTest.groovy
Fixes for class loader caching.

We weren't distinguishing between runtime loaders for the different passes of a build script. This meant that if a script contained a `buildscript {}` block, then we'd cache the loader for the first pass. We'd then run the second path with the same loader id, and a different effective loader. This would evict the first pass loader, which would then be evicted on the next build etc. The build script class loader ids now indicate the phase, allowing both loaders to be cached.

We weren't releasing loaders when scripts disappeared. We now explicitly “remove” runtime script loaders if the script is empty. This also required giving empty and missing scripts) identity, in terms of the file that should have contained the script.

Reworking the testing infrastructure raised these issues, and some other bad assumptions that the tests were incorrectly attempting to assert.

+review REVIEW-5411

    • -54
    • +315
    ./ClassLoadersCachingIntegrationTest.groovy
  1. … 31 more files in changeset.
Temporarily ignore failing test.

+review REVIEW-5411

    • -0
    • +1
    ./ClassLoadersCachingIntegrationTest.groovy
Relax class caching test to assert that cache did not grow, as opposed to did not change size.

+review REVIEW-5411

    • -1
    • +1
    ./ClassLoadersCachingIntegrationTest.groovy