Fix TestNG tracing for parameterized tests that modify parameters#7226
Merged
nikita-tkachenko-datadog merged 2 commits intoJun 26, 2024
Merged
Conversation
BenchmarksStartupParameters
See matching parameters
SummaryFound 0 performance improvements and 1 performance regressions! Performance is the same for 48 metrics, 14 unstable metrics.
Startup time reports for insecure-bankgantt
title insecure-bank - global startup overhead: candidate=1.36.0-SNAPSHOT~b181b7cee6, baseline=1.36.0-SNAPSHOT~9f7d0c27cd
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.061 s) : 0, 1061326
Total [baseline] (8.542 s) : 0, 8542265
Agent [candidate] (1.063 s) : 0, 1063238
Total [candidate] (8.561 s) : 0, 8561291
section iast
Agent [baseline] (1.178 s) : 0, 1178226
Total [baseline] (9.04 s) : 0, 9039907
Agent [candidate] (1.171 s) : 0, 1170548
Total [candidate] (8.991 s) : 0, 8991000
section iast_HARDCODED_SECRET_DISABLED
Agent [baseline] (1.178 s) : 0, 1177820
Total [baseline] (8.997 s) : 0, 8996835
Agent [candidate] (1.168 s) : 0, 1167660
Total [candidate] (8.979 s) : 0, 8978998
section iast_TELEMETRY_OFF
Agent [baseline] (1.176 s) : 0, 1176475
Total [baseline] (9.001 s) : 0, 9001231
Agent [candidate] (1.165 s) : 0, 1165224
Total [candidate] (8.984 s) : 0, 8984496
gantt
title insecure-bank - break down per module: candidate=1.36.0-SNAPSHOT~b181b7cee6, baseline=1.36.0-SNAPSHOT~9f7d0c27cd
dateFormat X
axisFormat %s
section tracing
BytebuddyAgent [baseline] (664.659 ms) : 0, 664659
BytebuddyAgent [candidate] (666.403 ms) : 0, 666403
GlobalTracer [baseline] (304.348 ms) : 0, 304348
GlobalTracer [candidate] (303.876 ms) : 0, 303876
AppSec [baseline] (49.819 ms) : 0, 49819
AppSec [candidate] (50.276 ms) : 0, 50276
Remote Config [baseline] (697.96 µs) : 0, 698
Remote Config [candidate] (687.529 µs) : 0, 688
Telemetry [baseline] (7.603 ms) : 0, 7603
Telemetry [candidate] (7.568 ms) : 0, 7568
section iast
BytebuddyAgent [baseline] (785.816 ms) : 0, 785816
BytebuddyAgent [candidate] (780.57 ms) : 0, 780570
GlobalTracer [baseline] (295.97 ms) : 0, 295970
GlobalTracer [candidate] (293.305 ms) : 0, 293305
AppSec [baseline] (47.211 ms) : 0, 47211
AppSec [candidate] (47.032 ms) : 0, 47032
IAST [baseline] (28.245 ms) : 0, 28245
IAST [candidate] (27.294 ms) : 0, 27294
Remote Config [baseline] (614.906 µs) : 0, 615
Remote Config [candidate] (598.992 µs) : 0, 599
Telemetry [baseline] (7.013 ms) : 0, 7013
Telemetry [candidate] (8.453 ms) : 0, 8453
section iast_HARDCODED_SECRET_DISABLED
BytebuddyAgent [baseline] (784.991 ms) : 0, 784991
BytebuddyAgent [candidate] (778.363 ms) : 0, 778363
GlobalTracer [baseline] (296.611 ms) : 0, 296611
GlobalTracer [candidate] (293.621 ms) : 0, 293621
AppSec [baseline] (47.474 ms) : 0, 47474
AppSec [candidate] (46.876 ms) : 0, 46876
IAST [baseline] (26.934 ms) : 0, 26934
IAST [candidate] (27.976 ms) : 0, 27976
Remote Config [baseline] (608.882 µs) : 0, 609
Remote Config [candidate] (632.63 µs) : 0, 633
Telemetry [baseline] (7.768 ms) : 0, 7768
Telemetry [candidate] (6.877 ms) : 0, 6877
section iast_TELEMETRY_OFF
BytebuddyAgent [baseline] (783.236 ms) : 0, 783236
BytebuddyAgent [candidate] (776.777 ms) : 0, 776777
GlobalTracer [baseline] (296.034 ms) : 0, 296034
GlobalTracer [candidate] (293.174 ms) : 0, 293174
AppSec [baseline] (47.525 ms) : 0, 47525
AppSec [candidate] (46.987 ms) : 0, 46987
IAST [baseline] (26.558 ms) : 0, 26558
IAST [candidate] (25.269 ms) : 0, 25269
Remote Config [baseline] (610.317 µs) : 0, 610
Remote Config [candidate] (593.043 µs) : 0, 593
Telemetry [baseline] (9.076 ms) : 0, 9076
Telemetry [candidate] (9.095 ms) : 0, 9095
Startup time reports for petclinicgantt
title petclinic - global startup overhead: candidate=1.36.0-SNAPSHOT~b181b7cee6, baseline=1.36.0-SNAPSHOT~9f7d0c27cd
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.069 s) : 0, 1068681
Total [baseline] (10.371 s) : 0, 10371191
Agent [candidate] (1.062 s) : 0, 1061655
Total [candidate] (10.325 s) : 0, 10325226
section appsec
Agent [baseline] (1.19 s) : 0, 1190176
Total [baseline] (10.536 s) : 0, 10536024
Agent [candidate] (1.185 s) : 0, 1184753
Total [candidate] (10.45 s) : 0, 10449946
section iast
Agent [baseline] (1.178 s) : 0, 1178272
Total [baseline] (10.715 s) : 0, 10715067
Agent [candidate] (1.18 s) : 0, 1179910
Total [candidate] (10.679 s) : 0, 10679277
section profiling
Agent [baseline] (1.263 s) : 0, 1263010
Total [baseline] (10.622 s) : 0, 10622185
Agent [candidate] (1.276 s) : 0, 1275838
Total [candidate] (10.703 s) : 0, 10703307
gantt
title petclinic - break down per module: candidate=1.36.0-SNAPSHOT~b181b7cee6, baseline=1.36.0-SNAPSHOT~9f7d0c27cd
dateFormat X
axisFormat %s
section tracing
BytebuddyAgent [baseline] (670.317 ms) : 0, 670317
BytebuddyAgent [candidate] (665.367 ms) : 0, 665367
GlobalTracer [baseline] (305.216 ms) : 0, 305216
GlobalTracer [candidate] (303.254 ms) : 0, 303254
AppSec [baseline] (50.077 ms) : 0, 50077
AppSec [candidate] (50.299 ms) : 0, 50299
Remote Config [baseline] (750.052 µs) : 0, 750
Remote Config [candidate] (695.093 µs) : 0, 695
Telemetry [baseline] (7.609 ms) : 0, 7609
Telemetry [candidate] (7.558 ms) : 0, 7558
section appsec
BytebuddyAgent [baseline] (682.139 ms) : 0, 682139
BytebuddyAgent [candidate] (677.343 ms) : 0, 677343
GlobalTracer [baseline] (299.858 ms) : 0, 299858
GlobalTracer [candidate] (298.324 ms) : 0, 298324
AppSec [baseline] (154.038 ms) : 0, 154038
AppSec [candidate] (153.952 ms) : 0, 153952
IAST [baseline] (19.9 ms) : 0, 19900
IAST [candidate] (21.751 ms) : 0, 21751
Remote Config [baseline] (652.632 µs) : 0, 653
Remote Config [candidate] (640.537 µs) : 0, 641
Telemetry [baseline] (8.814 ms) : 0, 8814
Telemetry [candidate] (9.066 ms) : 0, 9066
section iast
BytebuddyAgent [baseline] (786.277 ms) : 0, 786277
BytebuddyAgent [candidate] (787.258 ms) : 0, 787258
GlobalTracer [baseline] (296.048 ms) : 0, 296048
GlobalTracer [candidate] (295.88 ms) : 0, 295880
AppSec [baseline] (47.436 ms) : 0, 47436
AppSec [candidate] (47.445 ms) : 0, 47445
IAST [baseline] (27.441 ms) : 0, 27441
IAST [candidate] (27.471 ms) : 0, 27471
Remote Config [baseline] (641.343 µs) : 0, 641
Remote Config [candidate] (616.05 µs) : 0, 616
Telemetry [baseline] (7.077 ms) : 0, 7077
Telemetry [candidate] (7.786 ms) : 0, 7786
section profiling
BytebuddyAgent [baseline] (663.658 ms) : 0, 663658
BytebuddyAgent [candidate] (671.113 ms) : 0, 671113
GlobalTracer [baseline] (388.133 ms) : 0, 388133
GlobalTracer [candidate] (389.178 ms) : 0, 389178
AppSec [baseline] (51.6 ms) : 0, 51600
AppSec [candidate] (51.922 ms) : 0, 51922
Remote Config [baseline] (676.246 µs) : 0, 676
Remote Config [candidate] (767.32 µs) : 0, 767
Telemetry [baseline] (7.424 ms) : 0, 7424
Telemetry [candidate] (7.453 ms) : 0, 7453
ProfilingAgent [baseline] (94.46 ms) : 0, 94460
ProfilingAgent [candidate] (97.685 ms) : 0, 97685
Profiling [baseline] (94.484 ms) : 0, 94484
Profiling [candidate] (97.709 ms) : 0, 97709
LoadParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 11 metrics, 17 unstable metrics. Request duration reports for petclinicgantt
title petclinic - request duration [CI 0.99] : candidate=1.36.0-SNAPSHOT~b181b7cee6, baseline=1.36.0-SNAPSHOT~9f7d0c27cd
dateFormat X
axisFormat %s
section baseline
no_agent (1.345 ms) : 1326, 1363
. : milestone, 1345,
appsec (1.742 ms) : 1718, 1767
. : milestone, 1742,
appsec_no_iast (1.718 ms) : 1693, 1742
. : milestone, 1718,
iast (1.477 ms) : 1454, 1500
. : milestone, 1477,
profiling (1.529 ms) : 1503, 1555
. : milestone, 1529,
tracing (1.475 ms) : 1452, 1499
. : milestone, 1475,
section candidate
no_agent (1.357 ms) : 1338, 1377
. : milestone, 1357,
appsec (1.718 ms) : 1694, 1742
. : milestone, 1718,
appsec_no_iast (1.733 ms) : 1708, 1757
. : milestone, 1733,
iast (1.483 ms) : 1460, 1507
. : milestone, 1483,
profiling (1.49 ms) : 1465, 1515
. : milestone, 1490,
tracing (1.477 ms) : 1452, 1501
. : milestone, 1477,
Request duration reports for insecure-bankgantt
title insecure-bank - request duration [CI 0.99] : candidate=1.36.0-SNAPSHOT~b181b7cee6, baseline=1.36.0-SNAPSHOT~9f7d0c27cd
dateFormat X
axisFormat %s
section baseline
no_agent (370.53 µs) : 351, 390
. : milestone, 371,
iast (483.733 µs) : 463, 505
. : milestone, 484,
iast_FULL (551.632 µs) : 531, 573
. : milestone, 552,
iast_GLOBAL (500.996 µs) : 480, 522
. : milestone, 501,
iast_HARDCODED_SECRET_DISABLED (480.694 µs) : 460, 502
. : milestone, 481,
iast_INACTIVE (459.248 µs) : 437, 481
. : milestone, 459,
iast_TELEMETRY_OFF (475.699 µs) : 455, 497
. : milestone, 476,
tracing (443.214 µs) : 422, 464
. : milestone, 443,
section candidate
no_agent (369.318 µs) : 350, 389
. : milestone, 369,
iast (485.777 µs) : 464, 507
. : milestone, 486,
iast_FULL (549.882 µs) : 529, 571
. : milestone, 550,
iast_GLOBAL (508.149 µs) : 487, 529
. : milestone, 508,
iast_HARDCODED_SECRET_DISABLED (482.016 µs) : 461, 503
. : milestone, 482,
iast_INACTIVE (451.412 µs) : 430, 472
. : milestone, 451,
iast_TELEMETRY_OFF (472.924 µs) : 452, 494
. : milestone, 473,
tracing (445.198 µs) : 425, 466
. : milestone, 445,
DacapoParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 12 metrics, 0 unstable metrics. Execution time for tomcatgantt
title tomcat - execution time [CI 0.99] : candidate=1.36.0-SNAPSHOT~b181b7cee6, baseline=1.36.0-SNAPSHOT~9f7d0c27cd
dateFormat X
axisFormat %s
section baseline
no_agent (1.466 ms) : 1455, 1478
. : milestone, 1466,
appsec (2.213 ms) : 2179, 2247
. : milestone, 2213,
iast (1.979 ms) : 1937, 2021
. : milestone, 1979,
iast_GLOBAL (2.022 ms) : 1980, 2064
. : milestone, 2022,
profiling (1.857 ms) : 1823, 1891
. : milestone, 1857,
tracing (1.839 ms) : 1807, 1872
. : milestone, 1839,
section candidate
no_agent (1.468 ms) : 1457, 1480
. : milestone, 1468,
appsec (2.222 ms) : 2188, 2256
. : milestone, 2222,
iast (1.975 ms) : 1934, 2015
. : milestone, 1975,
iast_GLOBAL (2.017 ms) : 1976, 2058
. : milestone, 2017,
profiling (1.869 ms) : 1835, 1902
. : milestone, 1869,
tracing (1.835 ms) : 1803, 1868
. : milestone, 1835,
Execution time for biojavagantt
title biojava - execution time [CI 0.99] : candidate=1.36.0-SNAPSHOT~b181b7cee6, baseline=1.36.0-SNAPSHOT~9f7d0c27cd
dateFormat X
axisFormat %s
section baseline
no_agent (15.334 s) : 15334000, 15334000
. : milestone, 15334000,
appsec (15.212 s) : 15212000, 15212000
. : milestone, 15212000,
iast (18.602 s) : 18602000, 18602000
. : milestone, 18602000,
iast_GLOBAL (17.856 s) : 17856000, 17856000
. : milestone, 17856000,
profiling (15.691 s) : 15691000, 15691000
. : milestone, 15691000,
tracing (14.973 s) : 14973000, 14973000
. : milestone, 14973000,
section candidate
no_agent (15.014 s) : 15014000, 15014000
. : milestone, 15014000,
appsec (15.018 s) : 15018000, 15018000
. : milestone, 15018000,
iast (19.084 s) : 19084000, 19084000
. : milestone, 19084000,
iast_GLOBAL (18.062 s) : 18062000, 18062000
. : milestone, 18062000,
profiling (14.865 s) : 14865000, 14865000
. : milestone, 14865000,
tracing (15.069 s) : 15069000, 15069000
. : milestone, 15069000,
|
romainkomorn-exdatadog
approved these changes
Jun 21, 2024
nikita-tkachenko-datadog
force-pushed
the
nikita-tkachenko/test-ng-parameters-fix
branch
from
June 26, 2024 12:04
b181b7c to
94d24cb
Compare
nikita-tkachenko-datadog
deleted the
nikita-tkachenko/test-ng-parameters-fix
branch
June 26, 2024 15:39
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What Does This Do
Fixes tracing for parameterized TestNG test cases that modify their own test parameters.
Additional Notes
The reason tracing breaks is because of the way test cases are matched in test event listener.
When a "test started" event is received, a
TestDescriptorinstance is created that identifies correspondingDDTestinstance.When a "test finished" event is receved, another
TestDescriptorinstance is created, and is used to look up theDDTestinstance created on test start.The descriptor contains a stringified version of test parameters.
If a test case modifies its parameters during execution, the descriptor created afterwards will contain a different string for test parameters representation.
As the result, it will not match the descriptor created earlier, and the
DDTestinstance will not be found.The fix is to use TestNG domain objects (
ITestResult) as the test descriptors: even if the parameters are modified, the test result instance is the same on test start and on test finish.Jira ticket: SDTEST-483