Skip to content

Fix Kafka Connect data streams test flake - #12187

Open
AlexeyKuznetsov-DD wants to merge 3 commits into
masterfrom
alexeyk/fix-kafka-connect-dsm-test-flake
Open

AlexeyKuznetsov-DD wants to merge 3 commits into
masterfrom
alexeyk/fix-kafka-connect-dsm-test-flake

Conversation

@AlexeyKuznetsov-DD

@AlexeyKuznetsov-DD AlexeyKuznetsov-DD commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

What Does This Do

  • Isolates the Kafka Connect source and sink instrumentation tests on separate topics.
  • Waits for the exact tagged producer-to-consumer data-stream pathway instead of assuming that any two recorded groups form the expected chain.

Motivation

GitLab job 1915544954 exposed a flaky sink instrumentation test. The shared topic retained the source test's record, so the sink connector could consume that stale record before the newly produced one. waitForGroups(2) then returned with a current producer group and an unrelated consumer group, causing the expected child lookup to return null.

Test failed with:

org.spockframework.runtime.SpockAssertionError: Target of 'verifyAll' block must not be null

Target of 'verifyAll' block must not be null
	at spock.lang.Specification.verifyAll(Specification.java:286)
	at ConnectWorkerInstrumentationTest.test kafka-connect sink instrumentation(ConnectWorkerInstrumentationTest.groovy:296)

And later passed via Develocity Gradle plugin retry.

Additional Notes

Validation:

  • ./gradlew :dd-java-agent:instrumentation:kafka:kafka-connect-0.11:test --tests 'ConnectWorkerInstrumentationTest' -PtestJvm=11 --rerun-tasks
  • ./gradlew :dd-java-agent:instrumentation:kafka:kafka-connect-0.11:spotlessCheck
  • Repository pre-commit formatting and CodeNarc checks

Relevant precedent PRs: none.

Contributor Checklist

Jira ticket: N/A

@AlexeyKuznetsov-DD AlexeyKuznetsov-DD added type: bug fix Bug fix tag: no release notes Changes to exclude from release notes inst: kafka Kafka instrumentation tag: ai generated Largely based on code generated by an AI or LLM labels Aug 11, 2026
@AlexeyKuznetsov-DD AlexeyKuznetsov-DD self-assigned this Aug 11, 2026
@dd-octo-sts

dd-octo-sts Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

🟡 Java Benchmark SLOs — Performance SLO warning (near threshold)

Suite Status
Startup 🟡 warning

SLO thresholds are defined here based on automatically generated metrics. A warning is raised when results are within 5% of the threshold.

PR vs. master results
Scenario Candidate master Δ (95% CI of mean)
startup:insecure-bank:iast:Agent 14.06 s 13.98 s [-0.2%; +1.3%] (no difference)
startup:insecure-bank:tracing:Agent 12.90 s 13.04 s [-1.8%; -0.3%] (maybe better)
startup:petclinic:appsec:Agent 17.71 s 17.55 s [+0.2%; +1.6%] (maybe worse)
startup:petclinic:iast:Agent 17.37 s 17.68 s [-2.5%; -1.0%] (significantly better)
startup:petclinic:profiling:Agent 17.39 s 17.31 s [-0.6%; +1.6%] (no difference)
startup:petclinic:sca:Agent 17.43 s 17.59 s [-2.0%; +0.2%] (no difference)
startup:petclinic:tracing:Agent 16.22 s 16.80 s [-7.7%; +0.8%] (no difference)

Commit: 1fc943bd · CI Pipeline · Benchmarking Platform UI


Load and DaCapo benchmarks can be triggered manually in the GitLab pipeline. Results will appear in the Benchmarking Platform UI after completion.

@AlexeyKuznetsov-DD
AlexeyKuznetsov-DD marked this pull request as ready for review August 11, 2026 17:21
@AlexeyKuznetsov-DD
AlexeyKuznetsov-DD requested review from a team as code owners August 11, 2026 17:21
@AlexeyKuznetsov-DD
AlexeyKuznetsov-DD requested review from jordan-wong and removed request for a team August 11, 2026 17:21
@pr-commenter

pr-commenter Bot commented Aug 11, 2026

Copy link
Copy Markdown

Kafka / producer-benchmark

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
git_branch master alexeyk/fix-kafka-connect-dsm-test-flake
git_commit_date 1789576632 1789591317
git_commit_sha 0e8becf 1fc943b
See matching parameters
Baseline Candidate
ci_job_date 1789592425 1789592425
ci_job_id 2051472113 2051472113
ci_pipeline_id 138010193 138010193
cpu_model Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz
jdkVersion 11.0.31 11.0.31
jmhVersion 1.36 1.36
jvm /usr/lib/jvm/java-11-openjdk-amd64/bin/java /usr/lib/jvm/java-11-openjdk-amd64/bin/java
jvmArgs -Dhttp.proxyHost=127.0.0.1 -Dhttp.proxyPort=15002 -Dhttps.proxyHost=127.0.0.1 -Dhttps.proxyPort=15002 -Dhttp.nonProxyHosts=localhost *.localhost
kernel_version Linux runner-zfyrx7zua-project-304-concurrent-0-q8hmc72v 6.8.0-1031-aws #33~22.04.1-Ubuntu SMP Thu Jun 26 14:22:30 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux Linux runner-zfyrx7zua-project-304-concurrent-0-q8hmc72v 6.8.0-1031-aws #33~22.04.1-Ubuntu SMP Thu Jun 26 14:22:30 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
vmName OpenJDK 64-Bit Server VM OpenJDK 64-Bit Server VM
vmVersion 11.0.31+11-post-1ubuntu1-22.04.2-Ubuntu 11.0.31+11-post-1ubuntu1-22.04.2-Ubuntu

Summary

Found 0 performance improvements and 0 performance regressions! Performance is the same for 3 metrics, 0 unstable metrics.

See unchanged results
scenario Δ mean throughput
scenario:not-instrumented/KafkaProduceBenchmark.benchProduce same
scenario:only-tracing-dsm-disabled-benchmarks/KafkaProduceBenchmark.benchProduce same
scenario:only-tracing-dsm-enabled-benchmarks/KafkaProduceBenchmark.benchProduce same

@pr-commenter

pr-commenter Bot commented Aug 11, 2026

Copy link
Copy Markdown

Kafka / consumer-benchmark

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
git_branch master alexeyk/fix-kafka-connect-dsm-test-flake
git_commit_date 1789576632 1789591317
git_commit_sha 0e8becf 1fc943b
See matching parameters
Baseline Candidate
ci_job_date 1789592520 1789592520
ci_job_id 2051472118 2051472118
ci_pipeline_id 138010193 138010193
cpu_model Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz
jdkVersion 11.0.31 11.0.31
jmhVersion 1.36 1.36
jvm /usr/lib/jvm/java-11-openjdk-amd64/bin/java /usr/lib/jvm/java-11-openjdk-amd64/bin/java
jvmArgs -Dhttp.proxyHost=127.0.0.1 -Dhttp.proxyPort=15002 -Dhttps.proxyHost=127.0.0.1 -Dhttps.proxyPort=15002 -Dhttp.nonProxyHosts=localhost *.localhost
kernel_version Linux runner-zfyrx7zua-project-304-concurrent-1-ge8vsu0z 6.8.0-1031-aws #33~22.04.1-Ubuntu SMP Thu Jun 26 14:22:30 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux Linux runner-zfyrx7zua-project-304-concurrent-1-ge8vsu0z 6.8.0-1031-aws #33~22.04.1-Ubuntu SMP Thu Jun 26 14:22:30 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
vmName OpenJDK 64-Bit Server VM OpenJDK 64-Bit Server VM
vmVersion 11.0.31+11-post-1ubuntu1-22.04.2-Ubuntu 11.0.31+11-post-1ubuntu1-22.04.2-Ubuntu

Summary

Found 0 performance improvements and 0 performance regressions! Performance is the same for 3 metrics, 0 unstable metrics.

See unchanged results
scenario Δ mean throughput
scenario:not-instrumented/KafkaConsumerBenchmark.benchConsume same
scenario:only-tracing-dsm-disabled-benchmarks/KafkaConsumerBenchmark.benchConsume same
scenario:only-tracing-dsm-enabled-benchmarks/KafkaConsumerBenchmark.benchConsume same

@datadog-official datadog-official Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Datadog Autotest: PASS

More details

Topic isolation prevents the source record from contaminating the sink case, while the exact pathway lookup correctly ignores stale topics and competing consumer groups and returns the intended producer-to-consumer chain.

Was this helpful? React 👍 or 👎

📊 Validated against 5 scenarios · Open Bits AI session

🤖 Datadog Autotest · Commit d9ea926 · What is Autotest? · @DataDog review to ask questions · Any feedback? Reach out in #autotest

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

inst: kafka Kafka instrumentation tag: ai generated Largely based on code generated by an AI or LLM tag: no release notes Changes to exclude from release notes type: bug fix Bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant