RFR: 8335684: Test ThreadCpuTime.java should pause like ThreadCpuTimeArray.java

Chris Plummer cjplummer at openjdk.org
Fri Jul 12 16:41:53 UTC 2024


On Mon, 8 Jul 2024 21:09:49 GMT, Kevin Walls <kevinw at openjdk.org> wrote:

>> test/jdk/java/lang/management/ThreadMXBean/ThreadCpuTime.java line 239:
>> 
>>> 237:                     " > ThreadUserTime = " + utime2);
>>> 238:             }
>>> 239: */
>> 
>> Shouldn't this be uncommented and this bit of testing restored? It seems the only reason it was commented out is because of Solaris, which we don't need to worry about anymore. Probably best to leave this to a separate PR if you are going to restore it.
>
> Would have been happy to test it and bring it back, have looked into it more:
> 
> back in jdk5u we have the same commented out code, we have never run this in general testing. 
> 
> I think it's redundant, the two calls are equivalent.
> 
>   long utime1 = mbean.getCurrentThreadUserTime();
> 
> "This is a convenient method for local management use and is equivalent to calling: getThreadUserTime(Thread.currentThread().getId());"
> 
> ..which is the other time we would be comparing it with:
> 
>   long utime2 = mbean.getThreadUserTime(getId()); (in this class that extends Thread).
>   
> I think we can presume some os-specific quirk that does not affect us today!

ok.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/20025#discussion_r1676184208


More information about the serviceability-dev mailing list