Caching creation is taking so long, how can I disable it?

I’m using Gradle to execute UI tests. I always get a fresh machine (Windows 7) due to execute it. During the test task, the caching is taking ~4min:

13:39:40.499 [DEBUG] [org.gradle.cache.internal.btree.BTreePersistentIndexedCache] Opening cache fileHashes.bin (C:<my_app>_1434740333.gradle\2.4\taskArtifacts\fileHashes.bin)
13:44:01.381 [INFO] [org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter] Executing task ‘:test’ (up-to-date check took 4 mins 25.785 secs) due to:
No history is available.

Wondering if it’s possible to disable the caching creation since this build is triggered only once and the cache creation is making it 4 min longer.

Have you tried running with --rerun-tasks?

Thanks for the quick reply. I tried with --rerun-tasks and I noticed with this param the cache creation in being done after test execution:

16:04:54.755 [INFO] [] Generating HTML test report…
16:04:54.827 [INFO] [] Finished generating test html results (0.072 secs) into: C:\project_1434740333\build\reports\tests
16:04:54.894 [DEBUG] [org.gradle.cache.internal.btree.BTreePersistentIndexedCache] Opening cache outputFileStates.bin (C:\project_1434740333.gradle\2.4\taskArtifacts\outputFileStates.bin)
16:04:54.923 [DEBUG] [org.gradle.cache.internal.btree.BTreePersistentIndexedCache] Opening cache fileHashes.bin (C:\project_1434740333.gradle\2.4\taskArtifacts\fileHashes.bin)
16:08:39.525 [DEBUG] [org.gradle.cache.internal.btree.BTreePersistentIndexedCache] Opening cache fileSnapshots.bin (C:\project_1434740333.gradle\2.4\taskArtifacts\fileSnapshots.bin)
16:08:39.634 [DEBUG] [org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter] Finished executing task ‘:test’

Here is my build.gradle

Ah, yes.

Is the C:\project_1434740333.gradle directory over some sort of networked file system?

@Rene is there something special that can be done to turn this sort of thing off?

I see no workaround for this as there is no flag to turn off checksum calculation after a task is successfully executed

C:\project_1434740333\.gradle is at local filesystem.

Some info about C:\project_1434740333\.gradle\build\classes
-Its content is all from an unpacked JAR. I’m doing that because it’s not possible to refer to tests of the classpath, so I need to unpack the jar due to have my tests executed.
-Size: 179 MB (188,571,648 bytes)
-32,300 Files, 1,759 Folders

Just to give a background of our project. Historically we have Ant scripts along with Java libraries to execute the tests, so I wanted to have a cleaner and more maintanable set of scripts, here comes Gradle!
Our project build all artifacts at once in order to be consumed within the pipeline stages. Initially I tried to setup the script to trigger the test consuming everything for a single JAR, however I faced the issue of not being able to refer to test classes from external dependencies. If it still relevant for the Gradle team, I’m glad to help with this implementation.

Here’s my workaround:
-set the JAR as a dependency
-expand from the JAR only the test classes

It let the build time to come down from ~5min to ~30sec.

Thanks for your support, keep up with the great work!