Skip to content

Commit

Permalink
8297742: Combine vmTestbase/nsk/monitoring/ThreadMXBean/resetPeakThre…
Browse files Browse the repository at this point in the history
…adCount tests

Reviewed-by: dholmes, lmesnik, kevinw, sspitsyn
  • Loading branch information
Alex Menkov committed Nov 30, 2022
1 parent 1323e98 commit 53dd214
Show file tree
Hide file tree
Showing 7 changed files with 64 additions and 248 deletions.
6 changes: 1 addition & 5 deletions test/hotspot/jtreg/TEST.quick-groups
Original file line number Diff line number Diff line change
Expand Up @@ -126,11 +126,7 @@ vmTestbase_nsk_monitoring_quick = \
vmTestbase/nsk/monitoring/ThreadMXBean/isThreadCpuTimeSupported/thcputime003/TestDescription.java \
vmTestbase/nsk/monitoring/ThreadMXBean/isThreadCpuTimeSupported/thcputime004/TestDescription.java \
vmTestbase/nsk/monitoring/ThreadMXBean/isThreadCpuTimeSupported/thcputime005/TestDescription.java \
vmTestbase/nsk/monitoring/ThreadMXBean/resetPeakThreadCount/reset001/TestDescription.java \
vmTestbase/nsk/monitoring/ThreadMXBean/resetPeakThreadCount/reset002/TestDescription.java \
vmTestbase/nsk/monitoring/ThreadMXBean/resetPeakThreadCount/reset003/TestDescription.java \
vmTestbase/nsk/monitoring/ThreadMXBean/resetPeakThreadCount/reset004/TestDescription.java \
vmTestbase/nsk/monitoring/ThreadMXBean/resetPeakThreadCount/reset005/TestDescription.java \
vmTestbase/nsk/monitoring/ThreadMXBean/resetPeakThreadCount/reset001.java \
vmTestbase/nsk/monitoring/LoggingMXBean/getLoggerLevel/getloggerlevel001/TestDescription.java \
vmTestbase/nsk/monitoring/LoggingMXBean/getLoggerLevel/getloggerlevel002/TestDescription.java \
vmTestbase/nsk/monitoring/LoggingMXBean/getLoggerLevel/getloggerlevel003/TestDescription.java \
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2007, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2007, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand All @@ -21,6 +21,67 @@
* questions.
*/

/*
* @test
*
* @summary converted from VM Testbase nsk/monitoring/ThreadMXBean/resetPeakThreadCount/reset001..reset005
* VM Testbase keywords: [quick, monitoring]
* VM Testbase readme:
* DESCRIPTION
* The test checks that
* ThreadMXBean.resetPeakThreadCount()
* returns correct result.
* The test starts a couple of user threads and waits until they finish. After
* that, resetPeakThreadCount() is invoked to reset the peak. Then
* getPeakThreadCount() and getThreadCount() must return the same values. The
* expectation is that no threads are created, or terminated, between
* "getPeakThreadCount()" and getThreadCount()" calls.
* The test implements defferent ways to access to the metrics.
*
* @comment Direct access to the metrics.
* @library /vmTestbase
* /test/lib
* @run main/othervm nsk.monitoring.ThreadMXBean.resetPeakThreadCount.reset001
*/

/*
* @test
* @comment Access to the metrics via default MBean server.
* @library /vmTestbase
* /test/lib
* @run main/othervm nsk.monitoring.ThreadMXBean.resetPeakThreadCount.reset001 -testMode=server
*/

/*
* @test
* @comment Access to the metrics via custom MBean server.
* @library /vmTestbase
* /test/lib
* @run main/othervm
* nsk.monitoring.ThreadMXBean.resetPeakThreadCount.reset001
* -testMode=server
* -MBeanServer=custom
*/

/*
* @test
* @comment Access to the metrics via default MBean server proxy.
* @library /vmTestbase
* /test/lib
* @run main/othervm nsk.monitoring.ThreadMXBean.resetPeakThreadCount.reset001 -testMode=proxy
*/

/*
* @test
* @comment Access to the metrics via custom MBean server proxy.
* @library /vmTestbase
* /test/lib
* @run main/othervm
* nsk.monitoring.ThreadMXBean.resetPeakThreadCount.reset001
* -testMode=proxy
* -MBeanServer=custom
*/

package nsk.monitoring.ThreadMXBean.resetPeakThreadCount;

import java.io.*;
Expand Down Expand Up @@ -54,7 +115,7 @@ public static int run(String[] argv, PrintStream out) {
testFailed = true;
}

// The test supposes that no threads are appered/disappeared between
// The test assumes that no threads are created or terminated between
// "getPeakThreadCount()" and "getThreadCount()" calls
monitor.resetPeakThreadCount();
int peak = monitor.getPeakThreadCount();
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

1 comment on commit 53dd214

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

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

Please sign in to comment.