Skip to content

Commit 16a66fc

Browse files
Code cleanup.
1 parent e705df1 commit 16a66fc

3 files changed

Lines changed: 8 additions & 25 deletions

File tree

.gitlab-ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ variables:
3131
GRADLE_PLUGIN_PROXY: "https://depot-read-api-java.us1.ddbuild.io/magicmirror/magicmirror/@current/"
3232
BUILDER_IMAGE_VERSION_PREFIX: "v26.01-" # use either an empty string (e.g. "") for latest images or a version followed by a hyphen (e.g. "v25.05-")
3333
REPO_NOTIFICATION_CHANNEL: "#apm-java-escalations"
34-
DEFAULT_TEST_JVMS: /^(8|ibm8)$/ # the latest "stable" version is 26
34+
DEFAULT_TEST_JVMS: /^(8|11|17|21|25|stable)$/ # the latest "stable" version is 26
3535
PROFILE_TESTS:
3636
description: "Enable profiling of tests"
3737
value: "false"

buildSrc/src/main/kotlin/datadog/gradle/plugin/dump/DumpHangedTestPlugin.kt

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -127,9 +127,9 @@ class DumpHangedTestPlugin : Plugin<Project> {
127127
val allJavaProcessesFile = file("all-java-processes")
128128
runCmd(Redirect.to(allJavaProcessesFile), "jcmd", "-l")
129129

130-
// On IBM JDK javacore can be collected by signaling the matching `Gradle Test Executor` process with `kill -3`.
130+
// On IBM JDK thread dump can be collected by signaling the matching `Gradle Test Executor` process with `kill -3`.
131131
// It will be writen into `/tmp/javacore.YYYYMMDD.HHMMSS.PID.SEQ.txt
132-
if (isIbm8Run(allJavaProcessesFile)) {
132+
if (isIbm8(allJavaProcessesFile)) {
133133
val allProcessesFile = file("all-processes")
134134
runCmd(Redirect.to(allProcessesFile), "ps", "-ef")
135135
extractPidsIbm8(allProcessesFile).forEach { ibm8Pid ->
@@ -183,7 +183,7 @@ class DumpHangedTestPlugin : Plugin<Project> {
183183
}
184184
}
185185

186-
private fun isIbm8Run(file: File): Boolean =
186+
private fun isIbm8(file: File): Boolean =
187187
file.readLines().any { it.contains("-PtestJvm=ibm8") }
188188

189189
private fun extractPids(file: File): List<String> =
@@ -201,7 +201,9 @@ class DumpHangedTestPlugin : Plugin<Project> {
201201
.toList()
202202
}
203203

204-
// ps -ef format starts with: UID PID PPID ...
204+
private val whitespaceRegex = Regex("\\s+")
205+
206+
// ps -ef format produce output like: UID PID PPID ...
205207
private fun extractPid(line: String): String? =
206-
line.trim().split(Regex("\\s+")).getOrNull(1)
208+
line.trimStart().split(whitespaceRegex, limit = 3).getOrNull(1)
207209
}

dd-smoke-tests/osgi/src/test/groovy/datadog/smoketest/IbmDumpTest.java

Lines changed: 0 additions & 19 deletions
This file was deleted.

0 commit comments

Comments
 (0)