Fix flaky test spring kafka template produce and batch consume#11168
Fix flaky test spring kafka template produce and batch consume#11168gh-worker-dd-mergequeue-cf854d[bot] merged 2 commits intomasterfrom
Conversation
cde2dd1 to
4688370
Compare
Kafka / producer-benchmarkParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 3 metrics, 0 unstable metrics. See unchanged results
|
BenchmarksStartupParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 63 metrics, 8 unstable metrics. Startup time reports for petclinicgantt
title petclinic - global startup overhead: candidate=1.62.0-SNAPSHOT~534d85ccf8, baseline=1.62.0-SNAPSHOT~63343baba3
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.057 s) : 0, 1057292
Total [baseline] (11.057 s) : 0, 11056749
Agent [candidate] (1.056 s) : 0, 1055720
Total [candidate] (11.128 s) : 0, 11127641
section appsec
Agent [baseline] (1.258 s) : 0, 1258028
Total [baseline] (10.977 s) : 0, 10976702
Agent [candidate] (1.261 s) : 0, 1261086
Total [candidate] (11.095 s) : 0, 11095329
section iast
Agent [baseline] (1.242 s) : 0, 1241507
Total [baseline] (11.531 s) : 0, 11530539
Agent [candidate] (1.25 s) : 0, 1249562
Total [candidate] (11.429 s) : 0, 11429384
section profiling
Agent [baseline] (1.185 s) : 0, 1184724
Total [baseline] (10.96 s) : 0, 10960484
Agent [candidate] (1.186 s) : 0, 1185685
Total [candidate] (10.98 s) : 0, 10980251
gantt
title petclinic - break down per module: candidate=1.62.0-SNAPSHOT~534d85ccf8, baseline=1.62.0-SNAPSHOT~63343baba3
dateFormat X
axisFormat %s
section tracing
crashtracking [baseline] (1.216 ms) : 0, 1216
crashtracking [candidate] (1.215 ms) : 0, 1215
BytebuddyAgent [baseline] (633.536 ms) : 0, 633536
BytebuddyAgent [candidate] (633.167 ms) : 0, 633167
AgentMeter [baseline] (29.632 ms) : 0, 29632
AgentMeter [candidate] (29.55 ms) : 0, 29550
GlobalTracer [baseline] (248.925 ms) : 0, 248925
GlobalTracer [candidate] (249.392 ms) : 0, 249392
AppSec [baseline] (32.297 ms) : 0, 32297
AppSec [candidate] (32.296 ms) : 0, 32296
Debugger [baseline] (59.661 ms) : 0, 59661
Debugger [candidate] (59.648 ms) : 0, 59648
Remote Config [baseline] (590.136 µs) : 0, 590
Remote Config [candidate] (585.013 µs) : 0, 585
Telemetry [baseline] (7.996 ms) : 0, 7996
Telemetry [candidate] (9.479 ms) : 0, 9479
Flare Poller [baseline] (7.435 ms) : 0, 7435
Flare Poller [candidate] (4.374 ms) : 0, 4374
section appsec
crashtracking [baseline] (1.211 ms) : 0, 1211
crashtracking [candidate] (1.223 ms) : 0, 1223
BytebuddyAgent [baseline] (672.07 ms) : 0, 672070
BytebuddyAgent [candidate] (674.173 ms) : 0, 674173
AgentMeter [baseline] (12.181 ms) : 0, 12181
AgentMeter [candidate] (12.11 ms) : 0, 12110
GlobalTracer [baseline] (248.553 ms) : 0, 248553
GlobalTracer [candidate] (248.886 ms) : 0, 248886
AppSec [baseline] (185.099 ms) : 0, 185099
AppSec [candidate] (185.529 ms) : 0, 185529
Debugger [baseline] (66.537 ms) : 0, 66537
Debugger [candidate] (66.766 ms) : 0, 66766
Remote Config [baseline] (554.451 µs) : 0, 554
Remote Config [candidate] (570.98 µs) : 0, 571
Telemetry [baseline] (7.882 ms) : 0, 7882
Telemetry [candidate] (7.838 ms) : 0, 7838
Flare Poller [baseline] (3.477 ms) : 0, 3477
Flare Poller [candidate] (3.432 ms) : 0, 3432
IAST [baseline] (24.212 ms) : 0, 24212
IAST [candidate] (24.276 ms) : 0, 24276
section iast
crashtracking [baseline] (1.232 ms) : 0, 1232
crashtracking [candidate] (1.244 ms) : 0, 1244
BytebuddyAgent [baseline] (817.075 ms) : 0, 817075
BytebuddyAgent [candidate] (822.351 ms) : 0, 822351
AgentMeter [baseline] (11.585 ms) : 0, 11585
AgentMeter [candidate] (11.635 ms) : 0, 11635
GlobalTracer [baseline] (240.458 ms) : 0, 240458
GlobalTracer [candidate] (242.242 ms) : 0, 242242
AppSec [baseline] (25.837 ms) : 0, 25837
AppSec [candidate] (31.701 ms) : 0, 31701
Debugger [baseline] (65.182 ms) : 0, 65182
Debugger [candidate] (65.281 ms) : 0, 65281
Remote Config [baseline] (532.695 µs) : 0, 533
Remote Config [candidate] (535.831 µs) : 0, 536
Telemetry [baseline] (7.765 ms) : 0, 7765
Telemetry [candidate] (7.868 ms) : 0, 7868
Flare Poller [baseline] (3.371 ms) : 0, 3371
Flare Poller [candidate] (3.462 ms) : 0, 3462
IAST [baseline] (31.577 ms) : 0, 31577
IAST [candidate] (26.893 ms) : 0, 26893
section profiling
ProfilingAgent [baseline] (93.922 ms) : 0, 93922
ProfilingAgent [candidate] (93.851 ms) : 0, 93851
crashtracking [baseline] (1.182 ms) : 0, 1182
crashtracking [candidate] (1.195 ms) : 0, 1195
BytebuddyAgent [baseline] (691.563 ms) : 0, 691563
BytebuddyAgent [candidate] (691.719 ms) : 0, 691719
AgentMeter [baseline] (9.146 ms) : 0, 9146
AgentMeter [candidate] (9.334 ms) : 0, 9334
GlobalTracer [baseline] (207.095 ms) : 0, 207095
GlobalTracer [candidate] (207.732 ms) : 0, 207732
AppSec [baseline] (32.778 ms) : 0, 32778
AppSec [candidate] (32.902 ms) : 0, 32902
Debugger [baseline] (65.86 ms) : 0, 65860
Debugger [candidate] (65.814 ms) : 0, 65814
Remote Config [baseline] (586.257 µs) : 0, 586
Remote Config [candidate] (573.39 µs) : 0, 573
Telemetry [baseline] (7.77 ms) : 0, 7770
Telemetry [candidate] (7.728 ms) : 0, 7728
Flare Poller [baseline] (3.552 ms) : 0, 3552
Flare Poller [candidate] (3.506 ms) : 0, 3506
Profiling [baseline] (94.482 ms) : 0, 94482
Profiling [candidate] (94.402 ms) : 0, 94402
Startup time reports for insecure-bankgantt
title insecure-bank - global startup overhead: candidate=1.62.0-SNAPSHOT~534d85ccf8, baseline=1.62.0-SNAPSHOT~63343baba3
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.066 s) : 0, 1066118
Total [baseline] (8.859 s) : 0, 8858571
Agent [candidate] (1.057 s) : 0, 1056611
Total [candidate] (8.851 s) : 0, 8850954
section iast
Agent [baseline] (1.234 s) : 0, 1233997
Total [baseline] (9.6 s) : 0, 9600134
Agent [candidate] (1.229 s) : 0, 1229108
Total [candidate] (9.579 s) : 0, 9578552
gantt
title insecure-bank - break down per module: candidate=1.62.0-SNAPSHOT~534d85ccf8, baseline=1.62.0-SNAPSHOT~63343baba3
dateFormat X
axisFormat %s
section tracing
crashtracking [baseline] (1.235 ms) : 0, 1235
crashtracking [candidate] (1.221 ms) : 0, 1221
BytebuddyAgent [baseline] (638.95 ms) : 0, 638950
BytebuddyAgent [candidate] (633.484 ms) : 0, 633484
AgentMeter [baseline] (29.804 ms) : 0, 29804
AgentMeter [candidate] (29.583 ms) : 0, 29583
GlobalTracer [baseline] (250.766 ms) : 0, 250766
GlobalTracer [candidate] (249.551 ms) : 0, 249551
AppSec [baseline] (32.651 ms) : 0, 32651
AppSec [candidate] (32.373 ms) : 0, 32373
Debugger [baseline] (59.387 ms) : 0, 59387
Debugger [candidate] (59.003 ms) : 0, 59003
Remote Config [baseline] (596.566 µs) : 0, 597
Remote Config [candidate] (591.397 µs) : 0, 591
Telemetry [baseline] (8.12 ms) : 0, 8120
Telemetry [candidate] (7.964 ms) : 0, 7964
Flare Poller [baseline] (8.205 ms) : 0, 8205
Flare Poller [candidate] (6.574 ms) : 0, 6574
section iast
crashtracking [baseline] (1.27 ms) : 0, 1270
crashtracking [candidate] (1.216 ms) : 0, 1216
BytebuddyAgent [baseline] (813.248 ms) : 0, 813248
BytebuddyAgent [candidate] (808.402 ms) : 0, 808402
AgentMeter [baseline] (11.416 ms) : 0, 11416
AgentMeter [candidate] (11.392 ms) : 0, 11392
GlobalTracer [baseline] (238.717 ms) : 0, 238717
GlobalTracer [candidate] (239.052 ms) : 0, 239052
IAST [baseline] (31.694 ms) : 0, 31694
IAST [candidate] (28.977 ms) : 0, 28977
AppSec [baseline] (26.252 ms) : 0, 26252
AppSec [candidate] (26.559 ms) : 0, 26559
Debugger [baseline] (62.079 ms) : 0, 62079
Debugger [candidate] (63.55 ms) : 0, 63550
Remote Config [baseline] (521.496 µs) : 0, 521
Remote Config [candidate] (522.598 µs) : 0, 523
Telemetry [baseline] (7.617 ms) : 0, 7617
Telemetry [candidate] (7.639 ms) : 0, 7639
Flare Poller [baseline] (3.363 ms) : 0, 3363
Flare Poller [candidate] (3.362 ms) : 0, 3362
LoadParameters
See matching parameters
SummaryFound 0 performance improvements and 2 performance regressions! Performance is the same for 19 metrics, 15 unstable metrics.
Request duration reports for petclinicgantt
title petclinic - request duration [CI 0.99] : candidate=1.62.0-SNAPSHOT~534d85ccf8, baseline=1.62.0-SNAPSHOT~63343baba3
dateFormat X
axisFormat %s
section baseline
no_agent (19.21 ms) : 19018, 19402
. : milestone, 19210,
appsec (19.094 ms) : 18899, 19289
. : milestone, 19094,
code_origins (17.95 ms) : 17774, 18126
. : milestone, 17950,
iast (18.069 ms) : 17893, 18244
. : milestone, 18069,
profiling (18.694 ms) : 18505, 18882
. : milestone, 18694,
tracing (18.006 ms) : 17827, 18185
. : milestone, 18006,
section candidate
no_agent (19.299 ms) : 19109, 19488
. : milestone, 19299,
appsec (18.71 ms) : 18518, 18902
. : milestone, 18710,
code_origins (17.722 ms) : 17548, 17895
. : milestone, 17722,
iast (17.806 ms) : 17631, 17980
. : milestone, 17806,
profiling (19.38 ms) : 19184, 19576
. : milestone, 19380,
tracing (18.309 ms) : 18126, 18492
. : milestone, 18309,
Request duration reports for insecure-bankgantt
title insecure-bank - request duration [CI 0.99] : candidate=1.62.0-SNAPSHOT~534d85ccf8, baseline=1.62.0-SNAPSHOT~63343baba3
dateFormat X
axisFormat %s
section baseline
no_agent (1.271 ms) : 1259, 1284
. : milestone, 1271,
iast (3.359 ms) : 3309, 3408
. : milestone, 3359,
iast_FULL (5.935 ms) : 5875, 5995
. : milestone, 5935,
iast_GLOBAL (3.699 ms) : 3640, 3758
. : milestone, 3699,
profiling (2.233 ms) : 2212, 2254
. : milestone, 2233,
tracing (1.909 ms) : 1892, 1925
. : milestone, 1909,
section candidate
no_agent (1.242 ms) : 1230, 1254
. : milestone, 1242,
iast (3.428 ms) : 3376, 3479
. : milestone, 3428,
iast_FULL (6.118 ms) : 6055, 6181
. : milestone, 6118,
iast_GLOBAL (3.696 ms) : 3628, 3763
. : milestone, 3696,
profiling (2.253 ms) : 2231, 2275
. : milestone, 2253,
tracing (1.905 ms) : 1888, 1921
. : milestone, 1905,
DacapoParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 10 metrics, 2 unstable metrics. Execution time for biojavagantt
title biojava - execution time [CI 0.99] : candidate=1.62.0-SNAPSHOT~534d85ccf8, baseline=1.62.0-SNAPSHOT~63343baba3
dateFormat X
axisFormat %s
section baseline
no_agent (14.974 s) : 14974000, 14974000
. : milestone, 14974000,
appsec (14.789 s) : 14789000, 14789000
. : milestone, 14789000,
iast (18.167 s) : 18167000, 18167000
. : milestone, 18167000,
iast_GLOBAL (17.939 s) : 17939000, 17939000
. : milestone, 17939000,
profiling (14.786 s) : 14786000, 14786000
. : milestone, 14786000,
tracing (14.902 s) : 14902000, 14902000
. : milestone, 14902000,
section candidate
no_agent (15.406 s) : 15406000, 15406000
. : milestone, 15406000,
appsec (14.681 s) : 14681000, 14681000
. : milestone, 14681000,
iast (18.581 s) : 18581000, 18581000
. : milestone, 18581000,
iast_GLOBAL (18.05 s) : 18050000, 18050000
. : milestone, 18050000,
profiling (15.366 s) : 15366000, 15366000
. : milestone, 15366000,
tracing (15.087 s) : 15087000, 15087000
. : milestone, 15087000,
Execution time for tomcatgantt
title tomcat - execution time [CI 0.99] : candidate=1.62.0-SNAPSHOT~534d85ccf8, baseline=1.62.0-SNAPSHOT~63343baba3
dateFormat X
axisFormat %s
section baseline
no_agent (1.481 ms) : 1470, 1493
. : milestone, 1481,
appsec (3.835 ms) : 3611, 4058
. : milestone, 3835,
iast (2.278 ms) : 2207, 2348
. : milestone, 2278,
iast_GLOBAL (2.318 ms) : 2247, 2388
. : milestone, 2318,
profiling (2.518 ms) : 2301, 2735
. : milestone, 2518,
tracing (2.078 ms) : 2024, 2132
. : milestone, 2078,
section candidate
no_agent (1.482 ms) : 1470, 1493
. : milestone, 1482,
appsec (3.813 ms) : 3591, 4035
. : milestone, 3813,
iast (2.28 ms) : 2210, 2350
. : milestone, 2280,
iast_GLOBAL (2.324 ms) : 2253, 2395
. : milestone, 2324,
profiling (2.099 ms) : 2044, 2155
. : milestone, 2099,
tracing (2.076 ms) : 2022, 2131
. : milestone, 2076,
|
Kafka / consumer-benchmarkParameters
See matching parameters
SummaryFound 0 performance improvements and 1 performance regressions! Performance is the same for 2 metrics, 0 unstable metrics.
See unchanged results
|
template produce and batch consume
4688370 to
3fc43ca
Compare
3fc43ca to
534d85c
Compare
| consumerRecords.each { | ||
| records.add(it) | ||
| } | ||
| @Override |
There was a problem hiding this comment.
The reformats here and below are probably due to a spotless trigger on commit. I'm not sure what has changed.
|
/merge |
|
View all feedbacks in Devflow UI.
The expected merge time in
|
What Does This Do
Fix
test spring kafka template produce and batch consumeSort both sides by the same key - producer span ID, so the correspondence is derived from the data rather than assumed by arrival order. Extract the three produce spans and sort them by spanId. Sort the consumer trace groups by the parentId of their kafka.deliver span, which equals the produce span ID of the message they consumed. By construction
produceSpans[i].spanId == sortedConsumerTraces[i].queueSpan.parentId, making the assertion stable regardless of partition assignment or async callback interleaving. Offsets are then verified per-span by reading them from the actualConsumerRecordlinked via thex-datadog-parent-idheader, preserving exact coverage without hardcoding.Motivation
The test hardcodes a fixed mapping between consumer trace group positions (
trace[1]→ first in sort order) and producer span positions (trace(0)[6]→ 3rd produce span). These two orderings are independent. Most of the time they happen to align, but ~1% of the time they diverge, causing the childOf assertion to find the wrong parent span.Additional Notes
test spring kafka template produce and batch consumesends 3 messages to a 2-partition topic and asserts the three kafka.deliver queue spans are children of specific kafka.produce spans using hardcoded indices into the sorted trace (trace(0)[2], [4], [6]). Because partition assignment is non-deterministic, the consumer trace groups arrive in the ListWriter in a different order run-to-run, so the hardcoded index-to-parent mapping is wrong whenever the partition distribution changes.Both the passing run and the failing run emitted exactly the same span structure: one 7-span producer trace and three 2-span consumer/queue traces. What differed was the pairing order.
Passing run — consumer queue spans arrived in parent order 1396, 1395, 1397, which happened to match the test's assumed order:
Failing run — partition 1 received two messages (offsets 0 and 1), partition 0 received one (offset 0), so the consumer queue spans arrived in parent order 1417, 1419, 1418 instead:
The assertion
span.parentId(1419) == parent.spanId(1418)failed.Log fragment:
Contributor Checklist
type:and (comp:orinst:) labels in addition to any other useful labelsclose,fix, or any linking keywords when referencing an issueUse
solvesinstead, and assign the PR milestone to the issueJira ticket: IDMPL-375
Note: Once your PR is ready to merge, add it to the merge queue by commenting
/merge./merge -ccancels the queue request./merge -f --reason "reason"skips all merge queue checks; please use this judiciously, as some checks do not run at the PR-level. For more information, see this doc.