Skip to content

Setup Validates runner tests for Spark4 runner#38478

Merged
Abacn merged 1 commit into
apache:masterfrom
Abacn:spark4-validate-runner
May 13, 2026
Merged

Setup Validates runner tests for Spark4 runner#38478
Abacn merged 1 commit into
apache:masterfrom
Abacn:spark4-validate-runner

Conversation

@Abacn
Copy link
Copy Markdown
Contributor

@Abacn Abacn commented May 12, 2026

Please add a meaningful description for your change here

Follow up of #38255, added Validates runner tests and portable validates runner tests.
Tested with running the test targets locally


Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:

  • Mention the appropriate issue in your description (for example: addresses #123), if applicable. This will automatically add a link to the pull request in the issue. If you would like the issue to automatically close on merging the pull request, comment fixes #<ISSUE NUMBER> instead.
  • Update CHANGES.md with noteworthy changes.
  • If this contribution is large, please file an Apache Individual Contributor License Agreement.

See the Contributor Guide for more tips on how to make review process smoother.

To check the build health, please visit https://github.com/apache/beam/blob/master/.test-infra/BUILD_STATUS.md

GitHub Actions Tests Status (on master branch)

Build python source distribution and wheels
Python tests
Java tests
Go tests

See CI.md for more information about GitHub Actions CI or the workflows README to see a list of phrases to trigger workflows.

@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request integrates ValidatesRunner and portable ValidatesRunner tests into the Spark 4 runner module. It ensures that structured streaming batch tests are properly executed as part of the validation suite, while temporarily excluding a specific test case that is currently failing due to an upstream issue.

Highlights

  • Test Configuration Update: Refactored test task configuration to use configureEach for better compatibility and added validatesStructuredStreamingRunnerBatch to the validatesRunner task dependency chain.
  • Test Exclusions: Excluded testHotKeyCombining from the structured streaming batch tests due to a known internal error related to method resolution.
New Features

🧠 You can now enable Memory (public preview) to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Ignored Files
  • Ignored by pattern: .github/workflows/** (4)
    • .github/workflows/README.md
    • .github/workflows/beam_PostCommit_Java_PVR_Spark4_Batch.yml
    • .github/workflows/beam_PostCommit_Java_PVR_Spark4_Streaming.yml
    • .github/workflows/beam_PostCommit_Java_ValidatesRunner_Spark4.yml
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@Abacn
Copy link
Copy Markdown
Contributor Author

Abacn commented May 12, 2026

R: @tkaymak

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request updates the Spark 4 runner build configuration to include necessary JVM arguments for Java 17 and adds a test exclusion for the structured streaming runner. The review feedback suggests expanding the --add-opens flags to prevent potential IllegalAccessException issues, adopting Gradle configuration avoidance practices by using tasks.named instead of eager configuration, and verifying that all intended test suites are correctly registered as dependencies for the validatesRunner task.

Comment on lines +39 to 44
tasks.withType(Test).configureEach {
jvmArgs "--add-opens=java.base/sun.nio.ch=ALL-UNNAMED",
"--add-opens=java.base/java.nio=ALL-UNNAMED",
"--add-opens=java.base/java.util=ALL-UNNAMED",
"--add-opens=java.base/java.lang.invoke=ALL-UNNAMED"
}
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.

high

Spark 4 on Java 17 typically requires a more comprehensive set of --add-opens flags to handle internal reflection used by Spark's memory management and serialization (e.g., Kryo). Missing flags like java.lang, java.io, and java.net can lead to IllegalAccessException in certain workloads.

tasks.withType(Test).configureEach {
  jvmArgs "--add-opens=java.base/sun.nio.ch=ALL-UNNAMED",
          "--add-opens=java.base/java.nio=ALL-UNNAMED",
          "--add-opens=java.base/java.util=ALL-UNNAMED",
          "--add-opens=java.base/java.lang=ALL-UNNAMED",
          "--add-opens=java.base/java.lang.invoke=ALL-UNNAMED",
          "--add-opens=java.base/java.io=ALL-UNNAMED",
          "--add-opens=java.base/java.net=ALL-UNNAMED",
          "--add-opens=java.base/java.util.concurrent=ALL-UNNAMED"
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This is not needed.

Comment on lines +46 to +52
tasks.validatesStructuredStreamingRunnerBatch {
filter {
// TODO(https://github.com/apache/beam/issues/36841): currently failing with INTERNAL_ERROR]
// Couldn't find method fromByteArray with arguments
excludeTestsMatching 'org.apache.beam.sdk.transforms.CombineTest$BasicTests.testHotKeyCombining'
}
}
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.

medium

To support Gradle configuration avoidance, it is recommended to use tasks.named(...).configure { ... } instead of eager task configuration. Additionally, fixed a minor typo in the TODO comment (missing opening bracket for [INTERNAL_ERROR]).

tasks.named("validatesStructuredStreamingRunnerBatch").configure {
  filter {
    // TODO(https://github.com/apache/beam/issues/36841): currently failing with [INTERNAL_ERROR]
    //  Couldn't find method fromByteArray with arguments
    excludeTestsMatching 'org.apache.beam.sdk.transforms.CombineTest$BasicTests.testHotKeyCombining'
  }
}

}
}

tasks.validatesRunner.dependsOn(validatesStructuredStreamingRunnerBatch)
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.

medium

The PR description mentions adding "portable validates runner tests", but they are not included as a dependency for the validatesRunner task. If validatesPortableRunnerBatch was intended to be part of this PR, it should be added here. Also, using tasks.named and string references for dependencies supports configuration avoidance.

tasks.named("validatesRunner").configure {
  dependsOn "validatesStructuredStreamingRunnerBatch"
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

this can be a follow up for Beam repo build.gradle as a whole

@github-actions
Copy link
Copy Markdown
Contributor

Stopping reviewer notifications for this pull request: review requested by someone other than the bot, ceding control. If you'd like to restart, comment assign set of reviewers

@Abacn
Copy link
Copy Markdown
Contributor Author

Abacn commented May 12, 2026

@Abacn
Copy link
Copy Markdown
Contributor Author

Abacn commented May 12, 2026

Also R: @shunping upcoming release manager

Copy link
Copy Markdown
Collaborator

@shunping shunping left a comment

Choose a reason for hiding this comment

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

Looks good. Thanks!

@Abacn Abacn merged commit 7ded0e0 into apache:master May 13, 2026
18 checks passed
@Abacn Abacn deleted the spark4-validate-runner branch May 13, 2026 15:01
@Abacn Abacn mentioned this pull request May 13, 2026
2 tasks
@tkaymak
Copy link
Copy Markdown
Contributor

tkaymak commented May 13, 2026

Sorry for my slow response, LGTM too 👍

Abacn added a commit that referenced this pull request May 13, 2026
… remaining review comments from #38255 (#38489)

* [runners-spark] Spark 4 follow-up: address remaining review comments from #38255

Addresses two trailing review comments left on PR #38255 at the
approved/merged head SHA that were never folded in before merge:

- Restore the `feature Y added to Java SDK` placeholder line in
  CHANGES.md Highlights (lost to a rebase). Comment:
  #38255 (comment)

- Delete two orphaned `.github/trigger_files/*.json`:
  - `beam_PreCommit_Java_Spark4_Versions.json`: its workflow YAML was
    deleted in #38255.
  - `beam_PostCommit_Java_ValidatesRunner_Spark4StructuredStreaming.json`:
    flagged as "not effective yet"; since then, #38478 renamed the
    associated workflow YAML to
    `beam_PostCommit_Java_ValidatesRunner_Spark4.yml`, so this trigger
    JSON is doubly orphaned.
  Comment:
  #38255 (comment)

The renamed workflow YAML stays in place; per the trigger-files
convention these JSONs are only added when an author wants to manually
trigger a specific PostCommit.

* Update CHANGES.md

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>

* Fix CHANGES.md URL: /pull/N -> /issues/N for validateChanges

* Update CHANGES.md

Co-authored-by: Yi Hu <huuyyi@gmail.com>

---------

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: Yi Hu <huuyyi@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants