-
Notifications
You must be signed in to change notification settings - Fork 6.1k
8368524: Tests are skipped and shown as passed in test/jdk/sun/security/pkcs11/Cipher/KeyWrap #27847
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
8368524: Tests are skipped and shown as passed in test/jdk/sun/security/pkcs11/Cipher/KeyWrap #27847
Conversation
|
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 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 |
|
❗ This change is not yet ready to be integrated. |
|
@nehajoshinj The following label will be automatically applied to this pull request:
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. |
|
/covered |
|
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! |
myankelev
left a comment
There was a problem hiding this 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); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 .
There was a problem hiding this 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); |
There was a problem hiding this comment.
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.
| 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<>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit:
| private static List<String> skippedAlgoList = new ArrayList<>(); | |
| private static final List<String> skippedAlgoList = new ArrayList<>(); |
|
Looks good to me |
This PR contain changes to handle skipped exception for below test cases.
Progress
Error
Issue
Reviewers
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/27847/head:pull/27847$ git checkout pull/27847Update a local copy of the PR:
$ git checkout pull/27847$ git pull https://git.openjdk.org/jdk.git pull/27847/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 27847View PR using the GUI difftool:
$ git pr show -t 27847Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/27847.diff
Using Webrev
Link to Webrev Comment