Skip to content

Commit fb6a1e8

Browse files
committed
chaos: restore Maven jar fallback, drop vthread-context-cascade from profiler-only run
1 parent 66478fb commit fb6a1e8

1 file changed

Lines changed: 20 additions & 5 deletions

File tree

utils/run-chaos-harness.sh

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,12 +76,25 @@ fi
7676
echo "Using: $(java -version 2>&1 | head -1)"
7777

7878
# --- ddprof jar --------------------------------------------------------------
79+
# Prefer a local build artifact. If absent and CURRENT_VERSION is set (CI
80+
# passes it in from the get-versions job), fall back to the Maven snapshot.
7981
DDPROF_JAR=$(ls "${ROOT}/ddprof-lib/build/libs/ddprof-"*.jar 2>/dev/null | head -1)
8082
if [ -z "${DDPROF_JAR}" ] || [ ! -f "${DDPROF_JAR}" ]; then
81-
echo "FAIL:no local ddprof jar found — build one first: ./gradlew :ddprof-lib:jar" >&2
82-
exit 1
83+
if [ -z "${CURRENT_VERSION:-}" ]; then
84+
echo "FAIL:no local ddprof jar found and CURRENT_VERSION is empty — build one first: ./gradlew :ddprof-lib:jar" >&2
85+
exit 1
86+
fi
87+
echo "Local ddprof jar not found — downloading ${CURRENT_VERSION} from Maven snapshots"
88+
( cd /tmp && mvn org.apache.maven.plugins:maven-dependency-plugin:2.1:get \
89+
-DrepoUrl=https://central.sonatype.com/repository/maven-snapshots/ \
90+
-Dartifact=com.datadoghq:ddprof:"${CURRENT_VERSION}" )
91+
DDPROF_JAR="/root/.m2/repository/com/datadoghq/ddprof/${CURRENT_VERSION}/ddprof-${CURRENT_VERSION}.jar"
92+
if [ ! -f "${DDPROF_JAR}" ]; then
93+
echo "FAIL:ddprof jar unavailable (Maven snapshot download failed)" >&2
94+
exit 1
95+
fi
8396
fi
84-
echo "Using local ddprof jar: ${DDPROF_JAR}"
97+
echo "Using ddprof jar: ${DDPROF_JAR}"
8598

8699
# --- dd-java-agent ------------------------------------------------------------
87100
DD_AGENT_JAR="${WORK_DIR}/dd-java-agent.jar"
@@ -117,8 +130,10 @@ fi
117130
case $CONFIG in
118131
profiler)
119132
ENABLEMENT="-Ddd.profiling.enabled=true -Ddd.trace.enabled=false"
120-
# @Trace is a no-op without the tracer, so trace-context is excluded here.
121-
DEFAULT_ANTAGONISTS="thread-churn,alloc-storm,vthread-churn,classloader-churn,vthread-context-cascade,bounded-pool,context-hop,consumer-group,hidden-class-churn,direct-memory,weakref-wave,dump-storm"
133+
# @Trace is a no-op without the tracer, so trace-context and
134+
# vthread-context-cascade (which is driven entirely by @Trace-annotated
135+
# methods) are excluded here.
136+
DEFAULT_ANTAGONISTS="thread-churn,alloc-storm,vthread-churn,classloader-churn,bounded-pool,context-hop,consumer-group,hidden-class-churn,direct-memory,weakref-wave,dump-storm"
122137
;;
123138
profiler+tracer)
124139
ENABLEMENT="-Ddd.profiling.enabled=true -Ddd.trace.enabled=true"

0 commit comments

Comments
 (0)