Skip to content

Commit 1c2f93a

Browse files
committed
fix: Try using a test task specific folder for user preference to avoid locks
1 parent b690a79 commit 1c2f93a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

buildSrc/src/main/kotlin/dd-trace-java.configure-tests.gradle.kts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@ tasks.withType<Test>().configureEach {
4242
!rootProject.providers.gradleProperty("rerun.tests.${project.name}").isPresent
4343
}
4444

45+
// Trick to avoid on CI: "Couldn't flush user prefs: java.util.prefs.BackingStoreException: Couldn't get file lock."
46+
// Use a task-specific user prefs directory
47+
systemProperty("java.util.prefs.userRoot", "$buildDir/tmp/userPrefs/${name}")
48+
4549
// Split up tests that want to run forked in their own separate JVM for generated tasks
4650
if (name.startsWith("forkedTest") || name.endsWith("ForkedTest")) {
4751
setExcludes(emptyList())

0 commit comments

Comments
 (0)