Skip to content

Fix Kafka Connect data streams test flake - #12187

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

Fix Kafka Connect data streams test flake#12187
AlexeyKuznetsov-DD wants to merge 1 commit 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 — All performance SLOs passed

Suite Status
Startup 🟢 pass

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.84 s 14.69 s [+0.3%; +1.8%] (maybe worse)
startup:insecure-bank:tracing:Agent 13.57 s 13.73 s [-1.9%; -0.4%] (maybe better)
startup:petclinic:appsec:Agent 16.83 s 17.13 s [-6.3%; +2.9%] (no difference)
startup:petclinic:iast:Agent 17.42 s 17.40 s [-0.7%; +1.0%] (no difference)
startup:petclinic:profiling:Agent 17.30 s 17.31 s [-1.4%; +1.3%] (no difference)
startup:petclinic:sca:Agent 17.34 s 17.24 s [-0.6%; +1.8%] (no difference)
startup:petclinic:tracing:Agent 16.47 s 16.15 s [-2.3%; +6.2%] (no difference)

Commit: d9ea9261 · 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 1786465468 1786467032
git_commit_sha a9a2f61 d9ea926
See matching parameters
Baseline Candidate
ci_job_date 1786468197 1786468197
ci_job_id 1942023441 1942023441
ci_pipeline_id 130258247 130258247
cpu_model Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz
jdkVersion 11.0.25 11.0.25
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
vmName OpenJDK 64-Bit Server VM OpenJDK 64-Bit Server VM
vmVersion 11.0.25+9-post-Ubuntu-1ubuntu122.04 11.0.25+9-post-Ubuntu-1ubuntu122.04

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 1786465468 1786467032
git_commit_sha a9a2f61 d9ea926
See matching parameters
Baseline Candidate
ci_job_date 1786468235 1786468235
ci_job_id 1942023442 1942023442
ci_pipeline_id 130258247 130258247
cpu_model Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz
jdkVersion 11.0.25 11.0.25
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
vmName OpenJDK 64-Bit Server VM OpenJDK 64-Bit Server VM
vmVersion 11.0.25+9-post-Ubuntu-1ubuntu122.04 11.0.25+9-post-Ubuntu-1ubuntu122.04

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