Skip to content

Avoid final field modifications in Karate instrumentation#11753

Draft
daniel-mohedano wants to merge 4 commits into
masterfrom
daniel.mohedano/jep-500-karate
Draft

Avoid final field modifications in Karate instrumentation#11753
daniel-mohedano wants to merge 4 commits into
masterfrom
daniel.mohedano/jep-500-karate

Conversation

@daniel-mohedano

@daniel-mohedano daniel-mohedano commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

What Does This Do

  • Avoids final field modifications in Karate instrumentation by:
    • Instead of substituting the ScenarioRuntime.result field after the retries with the intended final result, a new bytecode advice substitutes it at the FeatureResult.addResult() call. The original runtime's result is the entry Karate adds to FeatureResult after run() returns. The advice swaps only that entry (identity match in ExecutionContext), so intermediate retry adds and deserialization adds pass through unchanged: same canonical entry the old overwrite produced, hence same suite outcome.

Motivation

Avoid failures in future JDKs due to JEP 500: Prepare to Make Final Mean Final.

Additional Notes

Running an example project on JDK26 with JAVA_TOOL_OPTIONS=--illegal-final-field-mutation=debug produced the following logs:

Final field result in class com.intuit.karate.core.ScenarioRuntime has been unreflected for mutation ...

The build containing the fix doesn't produce the logs.

Contributor Checklist

  • Format the title according to the contribution guidelines
  • Assign the type: and (comp: or inst:) labels in addition to any other useful labels
  • Avoid using close, fix, or any linking keywords when referencing an issue
    Use solves instead, and assign the PR milestone to the issue
  • Update the CODEOWNERS file on source file addition, migration, or deletion
  • Update public documentation with any new configuration flags or behaviors
  • Add your completed PR to the merge queue by commenting /merge. You can also:
    • Customize the commit message associated with the merge with /merge --commit-message "..."
    • Remove your PR from the merge queue with /merge -c
    • Skip all merge queue checks with /merge -f --reason "reason"; please use this judiciously, as some checks do not run at the PR-level (note: the PR still needs to be mergeable, this will only skip the pre-merge build)
    • Get more information in this doc

Jira ticket: SDTEST-3867

@daniel-mohedano daniel-mohedano added type: enhancement Enhancements and improvements comp: ci visibility Continuous Integration Visibility labels Jun 26, 2026
@cit-pr-commenter-54b7da

cit-pr-commenter-54b7da Bot commented Jun 26, 2026

Copy link
Copy Markdown

Test Environment - sbt-scalatest

Job Status: 🟢 success

Scenario This PR (%) 7d median Δ 7d 30d median Δ 30d runs (7d/30d)
agent 54.04 54.33 $\color{green}{\blacktriangledown}$ -0.29 55.43 $\color{green}{\blacktriangledown}$ -1.39 58/190
agentEvpProxy 52.99 n/a n/a n/a n/a -

Baseline: median of @test.tracer_overhead on main (gitlab) over the last 7/30 days, per OSS project & scenario. Δ = this PR − baseline median; red ▲ = more overhead, green ▽ = less overhead than baseline.

@cit-pr-commenter-54b7da

cit-pr-commenter-54b7da Bot commented Jun 26, 2026

Copy link
Copy Markdown

Test Environment - nebula-release-plugin

Job Status: 🟢 success

Scenario This PR (%) 7d median Δ 7d 30d median Δ 30d runs (7d/30d)
agent 38.07 36.42 $\color{red}{\blacktriangle}$ +1.65 36.42 $\color{red}{\blacktriangle}$ +1.65 29/92
agentless 35.85 35.70 $\color{red}{\blacktriangle}$ +0.15 35.70 $\color{red}{\blacktriangle}$ +0.15 29/92
agentlessCodeCoverage 46.43 44.48 $\color{red}{\blacktriangle}$ +1.95 43.60 $\color{red}{\blacktriangle}$ +2.83 29/92
agentlessLineCoverage 75.59 74.82 $\color{red}{\blacktriangle}$ +0.77 74.82 $\color{red}{\blacktriangle}$ +0.77 28/91

Baseline: median of @test.tracer_overhead on main (gitlab) over the last 7/30 days, per OSS project & scenario. Δ = this PR − baseline median; red ▲ = more overhead, green ▽ = less overhead than baseline.

@cit-pr-commenter-54b7da

cit-pr-commenter-54b7da Bot commented Jun 26, 2026

Copy link
Copy Markdown

Test Environment - netflix-zuul

Job Status: 🟢 success

Scenario This PR (%) 7d median Δ 7d 30d median Δ 30d runs (7d/30d)
agent 86.59 86.07 $\color{red}{\blacktriangle}$ +0.52 86.07 $\color{red}{\blacktriangle}$ +0.52 29/135
agentless 78.59 81.05 $\color{green}{\blacktriangledown}$ -2.46 81.05 $\color{green}{\blacktriangledown}$ -2.46 28/134
agentlessCodeCoverage 94.26 95.12 $\color{green}{\blacktriangledown}$ -0.86 95.12 $\color{green}{\blacktriangledown}$ -0.86 28/132
agentlessLineCoverage 110.55 111.62 $\color{green}{\blacktriangledown}$ -1.07 111.62 $\color{green}{\blacktriangledown}$ -1.07 28/132

Baseline: median of @test.tracer_overhead on main (gitlab) over the last 7/30 days, per OSS project & scenario. Δ = this PR − baseline median; red ▲ = more overhead, green ▽ = less overhead than baseline.

@dd-octo-sts

dd-octo-sts Bot commented Jun 26, 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.81 s 14.59 s [+0.7%; +2.2%] (maybe worse)
startup:insecure-bank:tracing:Agent 13.57 s 13.71 s [-1.8%; -0.3%] (maybe better)
startup:petclinic:appsec:Agent 16.77 s 16.74 s [-0.7%; +1.1%] (no difference)
startup:petclinic:iast:Agent 16.87 s 16.93 s [-1.2%; +0.5%] (no difference)
startup:petclinic:profiling:Agent 16.87 s 16.90 s [-1.2%; +0.8%] (no difference)
startup:petclinic:sca:Agent 16.83 s 16.48 s [+1.2%; +3.1%] (significantly worse)
startup:petclinic:tracing:Agent 16.05 s 16.16 s [-1.8%; +0.5%] (no difference)

Commit: 9c0449a4 · 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.

@cit-pr-commenter-54b7da

cit-pr-commenter-54b7da Bot commented Jun 26, 2026

Copy link
Copy Markdown

Test Environment - jolokia

Job Status: 🟢 success

Scenario This PR (%) 7d median Δ 7d 30d median Δ 30d runs (7d/30d)
agent 95.88 93.23 $\color{red}{\blacktriangle}$ +2.65 93.23 $\color{red}{\blacktriangle}$ +2.65 29/95
agentless 91.42 89.58 $\color{red}{\blacktriangle}$ +1.84 89.58 $\color{red}{\blacktriangle}$ +1.84 30/95
agentlessCodeCoverage 100.26 99.00 $\color{red}{\blacktriangle}$ +1.26 99.00 $\color{red}{\blacktriangle}$ +1.26 28/93
agentlessLineCoverage 100.98 99.00 $\color{red}{\blacktriangle}$ +1.98 99.00 $\color{red}{\blacktriangle}$ +1.98 28/93

Baseline: median of @test.tracer_overhead on main (gitlab) over the last 7/30 days, per OSS project & scenario. Δ = this PR − baseline median; red ▲ = more overhead, green ▽ = less overhead than baseline.

@cit-pr-commenter-54b7da

cit-pr-commenter-54b7da Bot commented Jun 26, 2026

Copy link
Copy Markdown

Test Environment - sonar-kotlin

Job Status: 🟢 success

Scenario This PR (%) 7d median Δ 7d 30d median Δ 30d runs (7d/30d)
agent 12.58 12.87 $\color{green}{\blacktriangledown}$ -0.29 13.13 $\color{green}{\blacktriangledown}$ -0.55 27/94
agentless 11.17 11.88 $\color{green}{\blacktriangledown}$ -0.71 11.88 $\color{green}{\blacktriangledown}$ -0.71 26/93
agentlessCodeCoverage 14.14 14.81 $\color{green}{\blacktriangledown}$ -0.67 15.11 $\color{green}{\blacktriangledown}$ -0.97 26/93
agentlessLineCoverage 18.05 18.82 $\color{green}{\blacktriangledown}$ -0.77 18.82 $\color{green}{\blacktriangledown}$ -0.77 26/93

Baseline: median of @test.tracer_overhead on main (gitlab) over the last 7/30 days, per OSS project & scenario. Δ = this PR − baseline median; red ▲ = more overhead, green ▽ = less overhead than baseline.

@cit-pr-commenter-54b7da

cit-pr-commenter-54b7da Bot commented Jun 26, 2026

Copy link
Copy Markdown

Test Environment - okhttp

Job Status: 🟢 success

Scenario This PR (%) 7d median Δ 7d 30d median Δ 30d runs (7d/30d)
agent 18.95 19.20 $\color{green}{\blacktriangledown}$ -0.25 19.59 $\color{green}{\blacktriangledown}$ -0.64 31/98
agentless 18.95 19.20 $\color{green}{\blacktriangledown}$ -0.25 19.20 $\color{green}{\blacktriangledown}$ -0.25 30/99
agentlessCodeCoverage 21.93 22.09 $\color{green}{\blacktriangledown}$ -0.16 22.09 $\color{green}{\blacktriangledown}$ -0.16 30/96
agentlessLineCoverage 44.79 44.48 $\color{red}{\blacktriangle}$ +0.31 44.48 $\color{red}{\blacktriangle}$ +0.31 33/101

Baseline: median of @test.tracer_overhead on main (gitlab) over the last 7/30 days, per OSS project & scenario. Δ = this PR − baseline median; red ▲ = more overhead, green ▽ = less overhead than baseline.

@cit-pr-commenter-54b7da

cit-pr-commenter-54b7da Bot commented Jun 26, 2026

Copy link
Copy Markdown

Test Environment - spring_boot

Job Status: 🟢 success

Scenario This PR (%) 7d median Δ 7d 30d median Δ 30d runs (7d/30d)
agent 15.66 16.36 $\color{green}{\blacktriangledown}$ -0.70 16.04 $\color{green}{\blacktriangledown}$ -0.38 24/89
agentless 9.07 9.73 $\color{green}{\blacktriangledown}$ -0.66 9.73 $\color{green}{\blacktriangledown}$ -0.66 24/89
agentlessCodeCoverage 13.05 13.40 $\color{green}{\blacktriangledown}$ -0.35 13.13 $\color{green}{\blacktriangledown}$ -0.08 24/88
agentlessLineCoverage 32.52 32.95 $\color{green}{\blacktriangledown}$ -0.43 32.30 $\color{red}{\blacktriangle}$ +0.22 25/89

Baseline: median of @test.tracer_overhead on main (gitlab) over the last 7/30 days, per OSS project & scenario. Δ = this PR − baseline median; red ▲ = more overhead, green ▽ = less overhead than baseline.

@cit-pr-commenter-54b7da

cit-pr-commenter-54b7da Bot commented Jun 26, 2026

Copy link
Copy Markdown

Test Environment - sonar-java

Job Status: 🟢 success

Scenario This PR (%) 7d median Δ 7d 30d median Δ 30d runs (7d/30d)
agent 20.93 17.38 $\color{red}{\blacktriangle}$ +3.55 16.36 $\color{red}{\blacktriangle}$ +4.57 29/96
agentless 27.36 19.59 $\color{red}{\blacktriangle}$ +7.77 15.11 $\color{red}{\blacktriangle}$ +12.25 28/95
agentlessCodeCoverage 97.40 95.12 $\color{red}{\blacktriangle}$ +2.28 87.80 $\color{red}{\blacktriangle}$ +9.60 27/94
agentlessLineCoverage 155.07 133.64 $\color{red}{\blacktriangle}$ +21.43 141.90 $\color{red}{\blacktriangle}$ +13.17 26/93

Baseline: median of @test.tracer_overhead on main (gitlab) over the last 7/30 days, per OSS project & scenario. Δ = this PR − baseline median; red ▲ = more overhead, green ▽ = less overhead than baseline.

@cit-pr-commenter-54b7da

cit-pr-commenter-54b7da Bot commented Jun 29, 2026

Copy link
Copy Markdown

Test Environment - pass4s

Job Status: 🟢 success

Scenario This PR (%) 7d median Δ 7d 30d median Δ 30d runs (7d/30d)
agent 15.07 10.33 $\color{red}{\blacktriangle}$ +4.74 10.33 $\color{red}{\blacktriangle}$ +4.74 28/92
agentless 11.05 10.75 $\color{red}{\blacktriangle}$ +0.30 9.73 $\color{red}{\blacktriangle}$ +1.32 28/93
agentlessCodeCoverage 18.23 17.03 $\color{red}{\blacktriangle}$ +1.20 17.73 $\color{red}{\blacktriangle}$ +0.50 26/90

Baseline: median of @test.tracer_overhead on main (gitlab) over the last 7/30 days, per OSS project & scenario. Δ = this PR − baseline median; red ▲ = more overhead, green ▽ = less overhead than baseline.

@cit-pr-commenter-54b7da

cit-pr-commenter-54b7da Bot commented Jun 29, 2026

Copy link
Copy Markdown

Test Environment - reactive-streams-jvm

Job Status: 🟢 success

Scenario This PR (%) 7d median Δ 7d 30d median Δ 30d runs (7d/30d)
agent 19.30 21.65 $\color{green}{\blacktriangledown}$ -2.35 21.65 $\color{green}{\blacktriangledown}$ -2.35 29/142
agentless 16.57 18.82 $\color{green}{\blacktriangledown}$ -2.25 18.82 $\color{green}{\blacktriangledown}$ -2.25 28/140
agentlessCodeCoverage 17.78 19.99 $\color{green}{\blacktriangledown}$ -2.21 19.99 $\color{green}{\blacktriangledown}$ -2.21 28/140
agentlessLineCoverage 27.40 29.82 $\color{green}{\blacktriangledown}$ -2.42 29.82 $\color{green}{\blacktriangledown}$ -2.42 27/139

Baseline: median of @test.tracer_overhead on main (gitlab) over the last 7/30 days, per OSS project & scenario. Δ = this PR − baseline median; red ▲ = more overhead, green ▽ = less overhead than baseline.

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

Labels

comp: ci visibility Continuous Integration Visibility type: enhancement Enhancements and improvements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant