Skip to content
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

8277353: java/security/MessageDigest/ThreadSafetyTest.java test times out #6626

Closed
wants to merge 3 commits into from

Conversation

sisahoo
Copy link
Member

@sisahoo sisahoo commented Dec 1, 2021

This Test gets timeout during low cpu availability. It is modified to support extended timeout period during JTREG execution.


Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed

Issue

  • JDK-8277353: java/security/MessageDigest/ThreadSafetyTest.java test times out

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/6626/head:pull/6626
$ git checkout pull/6626

Update a local copy of the PR:
$ git checkout pull/6626
$ git pull https://git.openjdk.java.net/jdk pull/6626/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 6626

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

Using diff file

Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/6626.diff

@bridgekeeper
Copy link

@bridgekeeper bridgekeeper bot commented Dec 1, 2021

👋 Welcome back ssahoo! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk openjdk bot added the rfr label Dec 1, 2021
@openjdk
Copy link

@openjdk openjdk bot commented Dec 1, 2021

@sisahoo 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.

@openjdk openjdk bot added the security label Dec 1, 2021
@mlbridge
Copy link

@mlbridge mlbridge bot commented Dec 1, 2021

Webrevs

@wangweij
Copy link
Contributor

@wangweij wangweij commented Dec 1, 2021

Can you lower the threadsFactor or duration? Or set an upper limit for nTasks?

@sisahoo
Copy link
Member Author

@sisahoo sisahoo commented Dec 1, 2021

Can you lower the threadsFactor or duration? Or set an upper limit for nTasks?

I can reduce the threadFactor and duration to close to half(threadsFactor=2 and duration=2 Or hardcode nTasks=20) and i think there still will be enough threads to verify threadsafety. In that case default JTREG timeout period should be enough and no need for any additional timeout with @run tag.

@wangweij
Copy link
Contributor

@wangweij wangweij commented Dec 2, 2021

Can you lower the threadsFactor or duration? Or set an upper limit for nTasks?

I can reduce the threadFactor and duration to close to half(threadsFactor=2 and duration=2 Or hardcode nTasks=20) and i think there still will be enough threads to verify threadsafety. In that case default JTREG timeout period should be enough and no need for any additional timeout with @run tag.

Maybe you can contact the author of this test to see if that's enough.

@alexeybakhtin
Copy link
Contributor

@alexeybakhtin alexeybakhtin commented Dec 2, 2021

Hi @sisahoo,
Yes, I think the number of threads and duration can be lowered. For example like this:

diff --git a/test/jdk/java/security/MessageDigest/ThreadSafetyTest.java b/test/jdk/java/security/MessageDigest/ThreadSafetyTest.java
index 41ecbca2677..f179bd54257 100644
--- a/test/jdk/java/security/MessageDigest/ThreadSafetyTest.java
+++ b/test/jdk/java/security/MessageDigest/ThreadSafetyTest.java
@@ -25,7 +25,7 @@
* @test
* @bug 8241960
* @summary Confirm that java.security.MessageDigest is thread-safe after clone.
- * @run main/othervm ThreadSafetyTest 5 4
+ * @run main/othervm ThreadSafetyTest 5 2
*/

import java.security.MessageDigest;
@@ -56,7 +56,7 @@ public class ThreadSafetyTest {
duration = Integer.parseInt(args[1]);
}
int nProcessors = Runtime.getRuntime().availableProcessors();
- int nTasks = nProcessors * threadsFactor;
+ int nTasks = Math.min(nProcessors, 4) * threadsFactor;
System.out.println("Testing with " + nTasks + " threads on " +
nProcessors + " processors for " + duration +

@sisahoo
Copy link
Member Author

@sisahoo sisahoo commented Dec 3, 2021

Thanks Alexey, I have updated the threadsFactor=4 and duration=2. With this change the Test is completing ~50 seconds in my laptop which is taking half of time over original.

@alexeybakhtin
Copy link
Contributor

@alexeybakhtin alexeybakhtin commented Dec 6, 2021

Thank you. Looks good to me, but I'm not a reviewer

Copy link
Contributor

@wangweij wangweij left a comment

Looks good. Thanks.

@openjdk
Copy link

@openjdk openjdk bot commented Dec 6, 2021

@sisahoo 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:

8277353: java/security/MessageDigest/ThreadSafetyTest.java test times out

Reviewed-by: weijun

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 91 new commits pushed to the master branch:

  • 6994d80: 8278291: compiler/uncommontrap/TraceDeoptimizationNoRealloc.java fails with release VMs after JDK-8154011
  • 286a26c: 8278277: G1: Simplify implementation of G1GCPhaseTimes::record_or_add_time_secs
  • d14f06a: 8278031: MultiThreadedRefCounter should not use relaxed atomic decrement
  • 8d190dd: 8277496: Remove duplication in c1 Block successor lists
  • 194cdf4: 8277864: Compilation error thrown while doing a boxing conversion on selector expression
  • f39fe5b: 8154011: Make TraceDeoptimization a diagnostic flag
  • f180a45: 8278016: Add compiler tests to tier{2,3}
  • 104aa1f: 8268575: Annotations not visible on model elements before they are generated
  • 839b606: 8278143: Remove unused "argc" from ConstantPool::copy_bootstrap_arguments_at_impl
  • 267c024: 8265150: AsyncGetCallTrace crashes on ResourceMark
  • ... and 81 more: https://git.openjdk.java.net/jdk/compare/da2be99cfe1121d5a59fa575ea0ac425ad4dbd0f...master

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.

➡️ To integrate this PR with the above commit message to the master branch, type /integrate in a new comment.

@openjdk openjdk bot added the ready label Dec 6, 2021
@sisahoo
Copy link
Member Author

@sisahoo sisahoo commented Dec 7, 2021

/integrate

@openjdk
Copy link

@openjdk openjdk bot commented Dec 7, 2021

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

  • 10db0e4: 8277932: Subject:callAs() not throwing NPE when action is null
  • f148e3e: 8278318: Create {@Index} entries for key LangTools terms
  • 2ff1296: 8277957: Add test group for IPv6 exclusive testing
  • ea8d3c9: 8271566: DSA signature length value is not accurate in P11Signature
  • 239362d: 8247973: Javadoc incorrect for IdentityArrayList, IdentityLinkedList
  • 2c31a17: 8275082: Update XML Security for Java to 2.3.0
  • 70bad89: 8277497: Last column cell in the JTAble row is read as empty cell
  • 5045eb5: 8278273: Remove unnecessary exclusion of doclint accessibility checks
  • 587e540: 8210558: serviceability/sa/TestJhsdbJstackLock.java fails to find '^\s+- waiting to lock <0x[0-9a-f]+> (a java.lang.Class ...'
  • 082fdf4: 8172065: javax/swing/JTree/4908142/bug4908142.java The selected index should be "aad"
  • ... and 95 more: https://git.openjdk.java.net/jdk/compare/da2be99cfe1121d5a59fa575ea0ac425ad4dbd0f...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot closed this Dec 7, 2021
@openjdk openjdk bot added integrated and removed ready rfr labels Dec 7, 2021
@openjdk
Copy link

@openjdk openjdk bot commented Dec 7, 2021

@sisahoo Pushed as commit f22d157.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
integrated security
3 participants