Skip to content

8368524: Tests are skipped and shown as passed in test/jdk/sun/security/pkcs11/Cipher/KeyWrap#27847

Closed
nehajoshinj wants to merge 11 commits intoopenjdk:masterfrom
nehajoshinj:JDK-8368524/SkipExceptionIssue
Closed

8368524: Tests are skipped and shown as passed in test/jdk/sun/security/pkcs11/Cipher/KeyWrap#27847
nehajoshinj wants to merge 11 commits intoopenjdk:masterfrom
nehajoshinj:JDK-8368524/SkipExceptionIssue

Conversation

@nehajoshinj
Copy link
Contributor

@nehajoshinj nehajoshinj commented Oct 16, 2025

This PR contain changes to handle skipped exception for below test cases.

  • test/jdk/sun/security/pkcs11/Cipher/KeyWrap/XMLEncKAT.java
  • test/jdk/sun/security/pkcs11/Cipher/KeyWrap/TestGeneral.java
  • test/jdk/sun/security/pkcs11/Cipher/KeyWrap/NISTWrapKAT.java

Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue

Issue

  • JDK-8368524: Tests are skipped and shown as passed in test/jdk/sun/security/pkcs11/Cipher/KeyWrap (Bug - P4)

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/27847/head:pull/27847
$ git checkout pull/27847

Update a local copy of the PR:
$ git checkout pull/27847
$ git pull https://git.openjdk.org/jdk.git pull/27847/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 27847

View PR using the GUI difftool:
$ git pr show -t 27847

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/27847.diff

Using Webrev

Link to Webrev Comment

@bridgekeeper bridgekeeper bot added the oca Needs verification of OCA signatory status label Oct 16, 2025
@bridgekeeper
Copy link

bridgekeeper bot commented Oct 16, 2025

Hi @nehajoshinj, welcome to this OpenJDK project and thanks for contributing!

We do not recognize you as Contributor and need to ensure you have signed the Oracle Contributor Agreement (OCA). If you have not signed the OCA, please follow the instructions. Please fill in your GitHub username in the "Username" field of the application. Once you have signed the OCA, please let us know by writing /signed in a comment in this pull request.

If you already are an OpenJDK Author, Committer or Reviewer, please click here to open a new issue so that we can record that fact. Please use "Add GitHub user nehajoshinj" as summary for the issue.

If you are contributing this work on behalf of your employer and your employer has signed the OCA, please let us know by writing /covered in a comment in this pull request.

@openjdk
Copy link

openjdk bot commented Oct 16, 2025

@nehajoshinj This change now passes all automated pre-integration checks.

ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details.

After integration, the commit message for the final commit will be:

8368524: Tests are skipped and shown as passed in test/jdk/sun/security/pkcs11/Cipher/KeyWrap

Reviewed-by: myankelevich, rhalade

You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed.

At the time when this comment was updated there had been 13 new commits pushed to the master branch:

As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.

As you do not have Committer status in this project an existing Committer must agree to sponsor your change. Possible candidates are the reviewers of this PR (@myankelev, @rhalade) but any other Committer may sponsor as well.

➡️ To flag this PR as ready for integration with the above commit message, type /integrate in a new comment. (Afterwards, your sponsor types /sponsor in a new comment to perform the integration).

@openjdk openjdk bot changed the title JDK-8368524: Tests are skipped and shown as passed in test/jdk/sun/security/pkcs11/Cipher/KeyWrap 8368524: Tests are skipped and shown as passed in test/jdk/sun/security/pkcs11/Cipher/KeyWrap Oct 16, 2025
@openjdk openjdk bot added the security security-dev@openjdk.org label Oct 16, 2025
@openjdk
Copy link

openjdk bot commented Oct 16, 2025

@nehajoshinj The following label will be automatically applied to this pull request:

  • security

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command.

@nehajoshinj
Copy link
Contributor Author

/covered

@bridgekeeper bridgekeeper bot added the oca-verify Needs verification of OCA signatory status label Oct 16, 2025
@bridgekeeper
Copy link

bridgekeeper bot commented Oct 16, 2025

Thank you! Please allow for a few business days to verify that your employer has signed the OCA. Also, please note that pull requests that are pending an OCA check will not usually be evaluated, so your patience is appreciated!

Copy link
Member

@myankelev myankelev 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, just a few questions

if (keyLen > allowed) {
System.out.println("=> skip, exceeds max allowed size " + allowed);
return;
throw new SkippedException("Skip, exceeds max allowed size " + allowed);
Copy link
Member

Choose a reason for hiding this comment

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

I think it's better to keep this as is, as in case this throws skipped exception it will stop the rest of the tests and they will not run. This could cause the error to be thrown.

One of the options that come to mind is to have the line 399 testEnc(algo, (String)td[1], (int)td[2], (String)td[3], catch skipped exception and add to the skippedAlgoList.
Another option could be to pass boolean/status out the method and use it to check if test actually run.
Another option could be to keep the skipped list as a global var and append it from here directly.

These are not the only options, so if you think of something better - it's your call.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I kept the return statement as it is and made skippedAlgoList a global variable.
For each skip , we will add the element in the list .

Copy link
Member

@myankelev myankelev 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, just 2 questions

if (skippedAlgoList.isEmpty()) {
System.out.println("All Tests Passed");
} else {
System.err.println("Some tests were skipped : " + skippedAlgoList);
Copy link
Member

Choose a reason for hiding this comment

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

This will only log a skip this way. Please throw an exception in the end.

Suggested change
System.err.println("Some tests were skipped : " + skippedAlgoList);
throw new SkippedException("Some tests were skipped : " + skippedAlgoList);

// adapted from com/sun/crypto/provider/Cipher/KeyWrap/NISTWrapKAT.java
public class NISTWrapKAT extends PKCS11Test {

private static List<String> skippedAlgoList = new ArrayList<>();
Copy link
Member

Choose a reason for hiding this comment

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

nit:

Suggested change
private static List<String> skippedAlgoList = new ArrayList<>();
private static final List<String> skippedAlgoList = new ArrayList<>();

@myankelev
Copy link
Member

Looks good to me

@bridgekeeper bridgekeeper bot removed oca Needs verification of OCA signatory status oca-verify Needs verification of OCA signatory status labels Oct 23, 2025
@openjdk openjdk bot added the rfr Pull request is ready for review label Oct 23, 2025
@mlbridge
Copy link

mlbridge bot commented Oct 23, 2025

Webrevs

@bridgekeeper
Copy link

bridgekeeper bot commented Nov 18, 2025

@nehajoshinj This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply issue a /touch or /keepalive command to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration!

@nehajoshinj
Copy link
Contributor Author

/keepalive

@openjdk
Copy link

openjdk bot commented Nov 18, 2025

@nehajoshinj The pull request is being re-evaluated and the inactivity timeout has been reset.

Copy link
Member

@rhalade rhalade left a comment

Choose a reason for hiding this comment

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

Please fix the copyright header in XMLEncKAT.java (missing , after 2025)

@openjdk
Copy link

openjdk bot commented Dec 4, 2025

@nehajoshinj this pull request can not be integrated into master due to one or more merge conflicts. To resolve these merge conflicts and update this pull request you can run the following commands in the local repository for your personal fork:

git checkout JDK-8368524/SkipExceptionIssue
git fetch https://git.openjdk.org/jdk.git master
git merge FETCH_HEAD
# resolve conflicts and follow the instructions given by git merge
git commit -m "Merge master"
git push

@openjdk openjdk bot added the merge-conflict Pull request has merge conflict with target branch label Dec 4, 2025
@openjdk openjdk bot removed the merge-conflict Pull request has merge conflict with target branch label Dec 5, 2025
@myankelev
Copy link
Member

Thanks for fixing issues caused by JDK-8371262!

@nehajoshinj
Copy link
Contributor Author

nehajoshinj commented Dec 5, 2025

There is a slight change in the PR , earlier this PR contained changes to handle skipped exception for below test cases.

  • test/jdk/sun/security/pkcs11/Cipher/KeyWrap/XMLEncKAT.java
  • test/jdk/sun/security/pkcs11/Cipher/KeyWrap/TestGeneral.java
  • test/jdk/sun/security/pkcs11/Cipher/KeyWrap/NISTWrapKAT.java

But there is similar ticket https://bugs.openjdk.org/browse/JDK-8371262 which got merged before this change.
Now in this PR we are only fixing the issues caused by JDK-8371262 which is adding the 'continue' keyword back into the loop.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Dec 5, 2025
@nehajoshinj
Copy link
Contributor Author

/integrate

@openjdk openjdk bot added the sponsor Pull request is ready to be sponsored label Dec 8, 2025
@openjdk
Copy link

openjdk bot commented Dec 8, 2025

@nehajoshinj
Your change (at version afcffbd) is now ready to be sponsored by a Committer.

@rhalade
Copy link
Member

rhalade commented Dec 9, 2025

/sponsor

@openjdk
Copy link

openjdk bot commented Dec 9, 2025

Going to push as commit b99be50.
Since your change was applied there have been 41 commits pushed to the master branch:

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Dec 9, 2025
@openjdk openjdk bot closed this Dec 9, 2025
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review sponsor Pull request is ready to be sponsored labels Dec 9, 2025
@openjdk
Copy link

openjdk bot commented Dec 9, 2025

@rhalade @nehajoshinj Pushed as commit b99be50.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

@nehajoshinj nehajoshinj deleted the JDK-8368524/SkipExceptionIssue branch February 16, 2026 12:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

integrated Pull request has been integrated security security-dev@openjdk.org

Development

Successfully merging this pull request may close these issues.

3 participants