Skip to content

[GITHUB-6925] Fixing debugger tests.#9302

Draft
lahodaj wants to merge 4 commits intoapache:masterfrom
lahodaj:GITHUB-6925
Draft

[GITHUB-6925] Fixing debugger tests.#9302
lahodaj wants to merge 4 commits intoapache:masterfrom
lahodaj:GITHUB-6925

Conversation

@lahodaj
Copy link
Copy Markdown
Contributor

@lahodaj lahodaj commented Mar 27, 2026

It is my understanding failing tests for java/debugger.jpda.truffle may become an impediment to adopt JDK 21. So, this is an attempt to show a possible direction to fix the debugger.jpda.truffle tests. Instead of running the GraalVM launcher (which no longer exists), run java with the appropriate launcher class.

This patch currently only fixes JS, as that's what we already have/bundle. Hopefully support for R/Python/Ruby could be added, by downloading the appropriate libraries (if they exist) and adding the to the runtime classpath. I didn't try myself, though. Please feel free to enhance the patch.

A good property is that the tests no longer require the GraalVM, but can run on any supported JDK.

I did not (yet?) do updates to the GraalVM ${{ matrix.graal }} Tests GitHub Actions job. Should this be moved to GraalVM 21?

Please let me know what you think.

/cc @mbien , @JaroslavTulach


^Add meaningful description above

Click to collapse/expand PR instructions

By opening a pull request you confirm that, unless explicitly stated otherwise, the changes -

  • are all your own work, and you have the right to contribute them.
  • are contributed solely under the terms and conditions of the Apache License 2.0 (see section 5 of the license for more information).

Please make sure (eg. git log) that all commits have a valid name and email address for you in the Author field.

If you're a first time contributor, see the Contributing guidelines for more information.

If you're a committer, please label the PR before pressing "Create pull request" so that the right test jobs can run.

PR approval and merge checklist:

  1. Was this PR correctly labeled, did the right tests run? When did they run?
  2. Is this PR squashed?
  3. Are author name / email address correct? Are co-authors correctly listed? Do the commit messages need updates?
  4. Does the PR title and description still fit after the Nth iteration? Is the description sufficient to appear in the release notes?

If this PR targets the delivery branch: don't merge. (full wiki article)

@lahodaj lahodaj added this to the NB30 milestone Mar 27, 2026
@lahodaj lahodaj added GraalVM [ci] enable GraalVM tests debugger labels Mar 27, 2026
@mbien
Copy link
Copy Markdown
Member

mbien commented Mar 31, 2026

Good idea with using the already existing js wrapper module. This would allow to keep some tests enabled.

I did not (yet?) do updates to the GraalVM ${{ matrix.graal }} Tests GitHub Actions job. Should this be moved to GraalVM 21?

Exactly that would be great. Those two sections would need adjusting.

# TODO uses GraalVM 17 / 22.3.1 which is the last known release which offers all required language extensions
# GraalVM based on JDK 21+ doesn't support the 'gu' tool anymore - extensions are now regular application dependencies
graal: [ '22.3.1' ]

- name: Setup GraalVM ${{ matrix.graal }}
run: |
URL=https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-${{ matrix.graal }}/graalvm-ce-java17-linux-amd64-${{ matrix.graal }}.tar.gz
curl -L $URL | tar -xz
GRAALVM=`pwd`/graalvm-ce-java17-${{ matrix.graal }}
echo "JAVA_HOME=$GRAALVM" >> $GITHUB_ENV
- name: Setup GraalVM Languages (python, R, ruby and js)
run: $JAVA_HOME/bin/gu install --no-progress python R ruby js

the "Setup GraalVM Languages" step can be removed I suppose and the URL/filename might need an update now.

@jtulach
Copy link
Copy Markdown
Contributor

jtulach commented Mar 31, 2026

A good property is that the tests no longer require the GraalVM, but can run on any supported JDK.

Right, there is no need to run on GraalVM anymore! Testing debugging capabilities of debugger.jpda.truffle should be possible on OpenJDK21+

Instead of running the GraalVM launcher (which no longer exists), run java with the appropriate launcher class.

Yes, that sounds like the right approach.

This patch currently only fixes JS, as that's what we already have/bundle. Hopefully support for R/Python/Ruby could be added

  • R is being abandoned as far as I know.
  • Ruby isn't that much maintained either.
  • Python is still actively supported by GraalVM guys, but:
  • the debugger.jpda.truffle support is generic
  • getting it run for JavaScript should be enough to verify it works
  • thanks Jan for getting the tests running at all!
    • few times I wanted to do some refactorings of the code ...
    • but I always gave up due to non-functional tests


# - name: debugger.jpda.truffle
# run: ant $OPTS -f java/debugger.jpda.truffle test
- name: debugger.jpda.truffle
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.

+1, I am really glad to see the tests being run regularly!

<recursive/>
</test-dependency>
<test-dependency>
<code-name-base>org.netbeans.libs.graaljs</code-name-base>
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.

Graal.js is packaged as NetBeans module, so reusing it is a great idea.

return new JPDASupport (jpdaDebugger, pio);
}

public static JPDASupport attachScript(String launcher, String path) throws IOException, DebuggerStartException {
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.

Huge simplification by deleting a lot of code. Good work!

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

Labels

debugger GraalVM [ci] enable GraalVM tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants