Skip to content

Commit 501bb1b

Browse files
authored
Merge branch 'master' into PROF-13025
2 parents 6bdc537 + ea52d2d commit 501bb1b

File tree

31 files changed

+484
-75
lines changed

31 files changed

+484
-75
lines changed

.github/workflows/add-release-to-cloudfoundry.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
runs-on: ubuntu-latest
1111
steps:
1212
- name: Checkout "cloudfoundry" branch
13-
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # 6.0.0
13+
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # 6.0.1
1414
with:
1515
ref: cloudfoundry
1616
- name: Get release version

.github/workflows/analyze-changes.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616

1717
steps:
1818
- name: Checkout repository
19-
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # 6.0.0
19+
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # 6.0.1
2020
with:
2121
submodules: 'recursive'
2222
- name: Cache Gradle dependencies
@@ -30,7 +30,7 @@ jobs:
3030
${{ runner.os }}-gradle-
3131
3232
- name: Initialize CodeQL
33-
uses: github/codeql-action/init@fe4161a26a8629af62121b670040955b330f9af2 # v4.31.6
33+
uses: github/codeql-action/init@cf1bb45a277cb3c205638b2cd5c984db1c46a412 # v4.31.7
3434
with:
3535
languages: 'java'
3636
build-mode: 'manual'
@@ -49,7 +49,7 @@ jobs:
4949
--build-cache --parallel --stacktrace --no-daemon --max-workers=4
5050
5151
- name: Perform CodeQL Analysis and upload results to GitHub Security tab
52-
uses: github/codeql-action/analyze@fe4161a26a8629af62121b670040955b330f9af2 # v4.31.6
52+
uses: github/codeql-action/analyze@cf1bb45a277cb3c205638b2cd5c984db1c46a412 # v4.31.7
5353

5454
trivy:
5555
name: Analyze changes with Trivy
@@ -61,7 +61,7 @@ jobs:
6161

6262
steps:
6363
- name: Checkout repository
64-
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # 6.0.0
64+
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # 6.0.1
6565
with:
6666
submodules: 'recursive'
6767

@@ -114,7 +114,7 @@ jobs:
114114
TRIVY_JAVA_DB_REPOSITORY: ghcr.io/aquasecurity/trivy-java-db,public.ecr.aws/aquasecurity/trivy-java-db
115115

116116
- name: Upload Trivy scan results to GitHub Security tab
117-
uses: github/codeql-action/upload-sarif@fe4161a26a8629af62121b670040955b330f9af2 # v4.31.6
117+
uses: github/codeql-action/upload-sarif@cf1bb45a277cb3c205638b2cd5c984db1c46a412 # v4.31.7
118118
if: always()
119119
with:
120120
sarif_file: 'trivy-results.sarif'

.github/workflows/create-release-branch.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
echo "branch=release/${TAG%.0}.x" >> "$GITHUB_OUTPUT"
3939
4040
- name: Checkout dd-trace-java at tag
41-
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # 6.0.0
41+
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # 6.0.1
4242
with:
4343
ref: ${{ steps.determine-tag.outputs.tag }}
4444

.github/workflows/prune-old-pull-requests.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
pull-requests: write
1414
steps:
1515
- name: Prune old pull requests
16-
uses: actions/stale@5f858e3efba33a5ca4407a664cc011ad407f2008 # v10.1.0
16+
uses: actions/stale@997185467fa4f803885201cee163a9f38240193d # v10.1.1
1717
with:
1818
days-before-stale: -1 # Disable general stale bot
1919
days-before-pr-stale: 90 # Only enable stale bot for PRs with no activity for 90 days

.github/workflows/run-system-tests.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
name: ci-build
2626
steps:
2727
- name: Checkout repository
28-
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # 6.0.0
28+
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # 6.0.1
2929
with:
3030
submodules: 'recursive'
3131
fetch-depth: 0

.github/workflows/update-docker-build-image.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
policy: self.update-docker-build-image.create-pr
2626

2727
- name: Checkout the repository
28-
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
28+
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
2929
- name: Define the Docker build image tag to use
3030
id: define-tag
3131
run: |

.github/workflows/update-gradle-dependencies.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
policy: self.update-gradle-dependencies.create-pr
2020

2121
- name: Checkout repository
22-
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # 6.0.0
22+
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # 6.0.1
2323
with:
2424
submodules: "recursive"
2525
- name: Update Gradle dependencies

.github/workflows/update-jmxfetch-submodule.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
policy: self.update-jmxfetch-submodule.create-pr
2020

2121
- name: Checkout repository
22-
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # 6.0.0
22+
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # 6.0.1
2323

2424
- name: Update Submodule
2525
run: |

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())

dd-java-agent/agent-ci-visibility/civisibility-test-fixtures/src/main/groovy/datadog/trace/civisibility/CiVisibilitySmokeTest.groovy

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,13 @@ import datadog.trace.api.config.CiVisibilityConfig
66
import datadog.trace.api.config.GeneralConfig
77
import datadog.trace.api.config.TraceInstrumentationConfig
88
import datadog.trace.api.config.TracerConfig
9+
import java.nio.file.Paths
910
import spock.lang.Specification
11+
import spock.lang.TempDir
1012
import spock.util.environment.Jvm
1113

14+
import java.nio.file.Path
15+
1216
import static datadog.trace.util.ConfigStrings.propertyNameToSystemPropertyName
1317

1418
abstract class CiVisibilitySmokeTest extends Specification {
@@ -21,6 +25,9 @@ abstract class CiVisibilitySmokeTest extends Specification {
2125

2226
private static final Map<String,String> DEFAULT_TRACER_CONFIG = defaultJvmArguments()
2327

28+
@TempDir
29+
protected Path prefsDir
30+
2431
protected static String buildJavaHome() {
2532
if (Jvm.current.isJava8()) {
2633
return System.getenv("JAVA_8_HOME")
@@ -69,6 +76,9 @@ abstract class CiVisibilitySmokeTest extends Specification {
6976

7077
protected List<String> buildJvmArguments(String mockBackendIntakeUrl, String serviceName, Map<String, String> additionalArgs) {
7178
List<String> arguments = []
79+
80+
arguments += preventJulPrefsFileLock()
81+
7282
Map<String, String> argMap = buildJvmArgMap(mockBackendIntakeUrl, serviceName, additionalArgs)
7383

7484
// for convenience when debugging locally
@@ -85,6 +95,28 @@ abstract class CiVisibilitySmokeTest extends Specification {
8595
return arguments
8696
}
8797

98+
/**
99+
* Trick to prevent jul Prefs file lock issue on forked processes, in particular in CI which
100+
* runs on Linux and have competing processes trying to write to it, including the Gradle daemon.
101+
*
102+
* <pre><code>
103+
* Couldn't flush user prefs: java.util.prefs.BackingStoreException: Couldn't get file lock.
104+
* </code></pre>
105+
*
106+
* Note, some tests can setup arguments on spec level, so `prefsDir` will be `null` during
107+
* `setupSpec()`.
108+
*/
109+
protected String preventJulPrefsFileLock() {
110+
String prefsPath = (prefsDir ?: tempUserPrefsPath()).toAbsolutePath()
111+
return "-Djava.util.prefs.userRoot=$prefsPath".toString()
112+
}
113+
114+
private static Path tempUserPrefsPath() {
115+
String uniqueId = "${System.currentTimeMillis()}_${System.nanoTime()}_${Thread.currentThread().id}"
116+
Path prefsPath = Paths.get(System.getProperty("java.io.tmpdir"), "gradle-test-userPrefs", uniqueId)
117+
return prefsPath
118+
}
119+
88120
protected verifyEventsAndCoverages(String projectName, String toolchain, String toolchainVersion, List<Map<String, Object>> events, List<Map<String, Object>> coverages, List<String> additionalDynamicTags = []) {
89121
def additionalReplacements = ["content.meta.['test.toolchain']": "$toolchain:$toolchainVersion"]
90122

0 commit comments

Comments
 (0)