Skip to content

fix(build): add --add-opens JVM args to test task - #296

Merged
vladimir-gavrilenko merged 1 commit into
cadence-workflow:masterfrom
vladimir-gavrilenko:fix/gradle-test-add-opens
Oct 16, 2026
Merged

vladimir-gavrilenko merged 1 commit into
cadence-workflow:masterfrom
vladimir-gavrilenko:fix/gradle-test-add-opens

Conversation

@vladimir-gavrilenko

Copy link
Copy Markdown
Contributor

Which sample(s) or area?
Build (build.gradle)

What changed?

  • Added the --add-opens JVM args to the test task.
  • Extracted the args shared by execute and test into addOpensArgs.

Why?
On JDK 17 ./gradlew build failed in :test with InaccessibleObjectException (the Cadence client reflects into java.base) and the test run then hung. The execute task already had these flags.

How did you test it?

  • ./gradlew build on JDK 17: BUILD SUCCESSFUL.
  • Manual run, following the README:
    1. Start Cadence Server (compose file from the README): docker-compose up
    2. Register the domain. This is required once: without it the sample fails with Domain samples-domain does not exist: ./gradlew -q execute -PmainClass=com.uber.cadence.samples.common.RegisterDomain
    3. Run the sample, which prints Hello World!: ./gradlew -q execute -PmainClass=com.uber.cadence.samples.hello.HelloActivity

Potential risks
None expected; the flags only affect the test JVM.

Release notes
N/A

Documentation Changes
N/A

**Which sample(s) or area?**
Build (build.gradle)

**What changed?**
- Added the `--add-opens` JVM args to the `test` task.
- Extracted the args shared by `execute` and `test` into `addOpensArgs`.

**Why?**
On JDK 17 `./gradlew build` failed in `:test` with
InaccessibleObjectException (the Cadence client reflects into java.base)
and the test run then hung. The `execute` task already had these flags.

**How did you test it?**
- `./gradlew build` on JDK 17: BUILD SUCCESSFUL.
- Manual run, following the README:
  1. Start Cadence Server (compose file from the README):
     `docker-compose up`
  2. Register the domain. This is required once: without it the sample
     fails with `Domain samples-domain does not exist`:
     `./gradlew -q execute -PmainClass=com.uber.cadence.samples.common.RegisterDomain`
  3. Run the sample, which prints `Hello World!`:
     `./gradlew -q execute -PmainClass=com.uber.cadence.samples.hello.HelloActivity`

**Potential risks**
None expected; the flags only affect the test JVM.

**Release notes**
N/A

**Documentation Changes**
N/A

Signed-off-by: vladimirg <vladi.a.gavri@gmail.com>
@gitar-bot

gitar-bot Bot commented Oct 15, 2026

Copy link
Copy Markdown
Code Review ✅ Approved

🟡 Medium risk · Adding Java module --add-opens flags to the test JVM permits deeper reflective access, potentially masking encapsulation issues or changing test behavior.

Adds the --add-opens JVM args to the test task in build.gradle so ./gradlew build no longer fails with InaccessibleObjectException on JDK 17, by extracting the args shared with execute into addOpensArgs. No issues found.

Verification Rules 1/1 met

Functional validation No results

Rules 1 passed

✅ PR Description Quality Standards

For more verification details, comment gitar display:verbose.

Options

Auto-apply is off → Gitar will not commit updates to this branch.
Display: compact → Showing compact verification results.

Comment with these commands to change the behavior for this request:

Auto-apply Compact
gitar auto-apply:on         
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Gitar

@vladimir-gavrilenko
vladimir-gavrilenko merged commit c2dbce5 into cadence-workflow:master Oct 16, 2026
4 checks passed
@vladimir-gavrilenko
vladimir-gavrilenko deleted the fix/gradle-test-add-opens branch October 16, 2026 07:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants