Skip to content

Commit 13e851e

Browse files
committed
try running tests in parallel for more contention
1 parent 0d448f6 commit 13e851e

File tree

1 file changed

+8
-27
lines changed

1 file changed

+8
-27
lines changed

.gitlab-ci.yml

Lines changed: 8 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -245,31 +245,17 @@ test_all:
245245
for i in $(seq 1 $TOTAL_RUNS); do
246246
echo "=== Running iteration $i/$TOTAL_RUNS ==="
247247
248-
# Run base tests (non-forked) - use daemon for speed, compilation already done
249-
if ./gradlew :dd-java-agent:instrumentation:pekko-http-1.0:baseTest -PtestJvm=$testJvm --build-cache --stacktrace --parallel --max-workers=$GRADLE_WORKERS --offline --configure-on-demand; then
250-
echo "Iteration $i: Base test PASSED" | tee -a flaky_test_results/iteration_${i}_base.log
251-
BASE_RESULT="PASS"
252-
else
253-
echo "Iteration $i: Base test FAILED" | tee -a flaky_test_results/iteration_${i}_base.log
254-
BASE_RESULT="FAIL"
255-
fi
256-
257-
# Run forked tests - use daemon for speed, compilation already done
258-
if ./gradlew :dd-java-agent:instrumentation:pekko-http-1.0:forkedTest -PtestJvm=$testJvm --build-cache --stacktrace --parallel --max-workers=$GRADLE_WORKERS --offline --configure-on-demand; then
259-
echo "Iteration $i: Forked test PASSED" | tee -a flaky_test_results/iteration_${i}_forked.log
260-
FORKED_RESULT="PASS"
261-
else
262-
echo "Iteration $i: Forked test FAILED" | tee -a flaky_test_results/iteration_${i}_forked.log
263-
FORKED_RESULT="FAIL"
264-
fi
248+
./gradlew :dd-java-agent:instrumentation:pekko-http-1.0:baseTest -PtestJvm=$testJvm --build-cache --stacktrace --parallel --max-workers=$GRADLE_WORKERS --offline --configure-on-demand --quiet > flaky_test_results/iteration_${i}_base.log 2>&1 &
249+
BASE_PID=$!
250+
./gradlew :dd-java-agent:instrumentation:pekko-http-1.0:forkedTest -PtestJvm=$testJvm --build-cache --stacktrace --parallel --max-workers=$GRADLE_WORKERS --offline --configure-on-demand --quiet > flaky_test_results/iteration_${i}_forked.log 2>&1 &
251+
FORKED_PID=$!
265252
266-
# Track overall results
267-
if [[ "$BASE_RESULT" == "PASS" && "$FORKED_RESULT" == "PASS" ]]; then
253+
if wait $BASE_PID && wait $FORKED_PID; then
268254
PASSED=$((PASSED + 1))
269-
echo "Iteration $i: OVERALL PASSED" | tee -a flaky_test_results/summary.log
255+
echo "Iteration $i: PASSED" | tee -a flaky_test_results/summary.log
270256
else
271257
FAILED=$((FAILED + 1))
272-
echo "Iteration $i: OVERALL FAILED (Base: $BASE_RESULT, Forked: $FORKED_RESULT)" | tee -a flaky_test_results/summary.log
258+
echo "Iteration $i: FAILED" | tee -a flaky_test_results/summary.log
273259
fi
274260
275261
echo "Progress: $PASSED passed, $FAILED failed out of $i total runs"
@@ -279,12 +265,7 @@ test_all:
279265
echo "Total runs: $TOTAL_RUNS" | tee -a flaky_test_results/summary.log
280266
echo "Passed: $PASSED" | tee -a flaky_test_results/summary.log
281267
echo "Failed: $FAILED" | tee -a flaky_test_results/summary.log
282-
if command -v bc >/dev/null 2>&1; then
283-
echo "Success rate: $(echo "scale=2; $PASSED * 100 / $TOTAL_RUNS" | bc)%" | tee -a flaky_test_results/summary.log
284-
else
285-
echo "Success rate: $(( $PASSED * 100 / $TOTAL_RUNS ))%" | tee -a flaky_test_results/summary.log
286-
fi
287-
268+
288269
# Exit with error code if there were any failures - this helps quickly identify problematic JVMs
289270
if [ $FAILED -gt 0 ]; then
290271
exit 1

0 commit comments

Comments
 (0)