Skip to content

Add Spark 4.0.0 test suite on JDK 17 to spark_2.13 - #12049

Merged
gh-worker-dd-mergequeue-cf854d[bot] merged 2 commits into
masterfrom
adrien.boitreaud/spark4-jdk17-test-suite
Jul 23, 2026
Merged

Add Spark 4.0.0 test suite on JDK 17 to spark_2.13#12049
gh-worker-dd-mergequeue-cf854d[bot] merged 2 commits into
masterfrom
adrien.boitreaud/spark4-jdk17-test-suite

Conversation

@aboitreaud

@aboitreaud aboitreaud commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

What Does This Do

Adds a dedicated test_spark4 Gradle test suite to spark_2.13 that runs the existing instrumentation test fixtures against real Spark 4.0.0 jars on JDK 17+ (Spark 4.0 requires JDK 17 minimum), complementing the existing test_spark32 suite.

  • Wires up a new test_spark4 suite (spark-core/spark-sql/spark-yarn 4.0.0) with its own JDK constraints (17–23) and --add-opens flags mirroring Spark's own JavaModuleOptions defaults, since the tests start a SparkSession in-process rather than through Spark's launch scripts.
  • Forces protobuf-java:3.14.0 on the new suite's classpath to avoid a binary-incompatible transitive protobuf version pulled in by Spark 4.0.0.
  • Updates shared test fixtures (AbstractSparkListenerTest, AbstractSparkTest) to handle Spark 4 API/behavior differences: SparkListenerApplicationEnd's new constructor param, ANSI mode being on by default, and JDK 15+'s more detailed NullPointerException messages surfacing under the new JDK 17 suite.

No production/instrumentation code changes — this is purely test coverage catching up with Spark 4 support that already landed in earlier PRs.

Motivation

Better test coverage for recent Spark / Java version in the apache spark inst

Additional Notes

Contributor Checklist

Jira ticket: [PROJ-IDENT]

@aboitreaud
aboitreaud requested a review from a team as a code owner July 23, 2026 08:44
@dd-octo-sts

dd-octo-sts Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Hi! 👋 Thanks for your pull request! 🎉

To help us review it, please make sure to:

  • Add at least one type, and one component or instrumentation label to the pull request

If you need help, please check our contributing guidelines.

@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

The Spark 4 test suite is isolated to JDK 17 through 23, while the shared fixture changes preserve Spark 3 compatibility and account for Spark 4 constructor, helpful-NPE, and ANSI-mode differences. No diff-only behavioral regression was identified; no additional tests recommended: the new suite already exercises the relevant Spark 4 paths.

Was this helpful? React 👍 or 👎

Open Bits AI session

🤖 Datadog Autotest · Commit 70d750d · What is Autotest? · Any feedback? Reach out in #autotest

@aboitreaud aboitreaud added inst: apache spark Apache Spark instrumentation type: feature Enhancements and improvements labels Jul 23, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 70d750d676

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines +90 to +91
"--add-opens=java.base/java.nio=ALL-UNNAMED",
"--add-opens=java.base/java.lang.invoke=ALL-UNNAMED"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Pass Spark's full Java 17 module options

When test_spark4 actually runs on JDK 17+, the in-process SparkSession is not launched through Spark's scripts, so it only receives the options listed here plus the repo's generic java.lang/java.util opens. Spark 4.0.0's own JavaModuleOptions marks a larger default set as required for Java 17 (for example java.lang.reflect, java.io, java.net, java.util.concurrent, jdk.internal.ref, and sun.nio.ch), and Spark startup/SQL execution can fail with module-access errors without those options; please feed JavaModuleOptions.defaultModuleOptionArray() or mirror the full Spark list for this suite.

Useful? React with 👍 / 👎.

@datadog-official

This comment has been minimized.

@dd-octo-sts

dd-octo-sts Bot commented Jul 23, 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.09 s 13.99 s [+0.1%; +1.4%] (maybe worse)
startup:insecure-bank:tracing:Agent 12.97 s 13.07 s [-1.4%; -0.1%] (maybe better)
startup:petclinic:appsec:Agent 16.94 s 16.75 s [+0.3%; +2.1%] (maybe worse)
startup:petclinic:iast:Agent 16.93 s 16.96 s [-0.9%; +0.5%] (no difference)
startup:petclinic:profiling:Agent 16.21 s 16.90 s [-8.5%; +0.3%] (no difference)
startup:petclinic:sca:Agent 16.43 s 16.88 s [-6.9%; +1.6%] (no difference)
startup:petclinic:tracing:Agent 16.10 s 16.14 s [-1.2%; +0.8%] (no difference)

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

@aboitreaud

Copy link
Copy Markdown
Contributor Author

Confirming that the new test_spark4 suite actually ran its tests on this branch, on both supported JDKs:

JDK 17 — job 1885974670 (https://gitlab.ddbuild.io/DataDog/apm-reliability/dd-trace-java/-/jobs/1885974670) (test_inst: [17, 7/8])

  • SparkTest — 28 tests, all pass (1 pre-existing skip: "generate error tags in failed spans")
  • SparkStructuredStreamingTest — 3 tests, all pass
  • SparkListenerTest — 15 tests, all pass

JDK 21 — job 1885974678 (https://gitlab.ddbuild.io/DataDog/apm-reliability/dd-trace-java/-/jobs/1885974678) (test_inst: [21, ...]),

  • SparkTest — 27 pass, 1 skip (same known skip)
  • SparkStructuredStreamingTest — 4 pass
  • SparkListenerTest — 18 pass

As expected, test_spark4 is SKIPPED on JDK 25/tip due to the maxJavaVersion = VERSION_23 cap (Hadoop's UserGroupInformation breaks under JEP 486 / SecurityManager removal on JDK 24+), so no test events exist for those shards — consistent with the module's testJvmConstraints configuration.

@aboitreaud
aboitreaud added this pull request to the merge queue Jul 23, 2026
@dd-octo-sts

dd-octo-sts Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

/merge

@gh-worker-devflow-routing-ef8351

gh-worker-devflow-routing-ef8351 Bot commented Jul 23, 2026

Copy link
Copy Markdown

View all feedbacks in Devflow UI.

2026-07-23 13:37:52 UTC ℹ️ Start processing command /merge


2026-07-23 13:37:57 UTC ℹ️ MergeQueue: pull request added to the queue

The expected merge time in master is approximately 1h (p90).


2026-07-23 14:34:57 UTC ℹ️ MergeQueue: This merge request was merged

@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Jul 23, 2026
@gh-worker-dd-mergequeue-cf854d
gh-worker-dd-mergequeue-cf854d Bot merged commit 983a0be into master Jul 23, 2026
590 checks passed
@gh-worker-dd-mergequeue-cf854d
gh-worker-dd-mergequeue-cf854d Bot deleted the adrien.boitreaud/spark4-jdk17-test-suite branch July 23, 2026 14:34
@github-actions github-actions Bot added this to the 1.65.0 milestone Jul 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

inst: apache spark Apache Spark instrumentation type: feature Enhancements and improvements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants