RFR: 8260378: [TESTBUG] DcmdMBeanTestCheckJni.java reports false positive

Severin Gehwolf sgehwolf at openjdk.java.net
Tue Jan 26 11:40:48 UTC 2021


I propose to add additional context to the string which must not match after [JDK-8258836](https://bugs.openjdk.java.net/browse/JDK-8258836). This then passes the test for a fixed JDK (including JDKs with JDK-8187450 *not* fixed).

Testing:
- [x] Reverted the fix from product code of JDK-8258836, ran the test. Failed as expected.
- [x] Ran the updated test on current head. Passed.
- [x] Ran the updated test with [1] included. Passed even though the processes' stdout contained [2].

[1] Explicitly add a call to NetworkInterface.getNetworkInterfaces()
diff --git a/test/jdk/com/sun/management/DiagnosticCommandMBean/DcmdMBeanTestCheckJni.java b/test/jdk/com/sun/management/DiagnosticCommandMBean/DcmdMBeanTestCheckJni.java
index 73e53da63f1..4f32af3f463 100644
--- a/test/jdk/com/sun/management/DiagnosticCommandMBean/DcmdMBeanTestCheckJni.java
+++ b/test/jdk/com/sun/management/DiagnosticCommandMBean/DcmdMBeanTestCheckJni.java
@@ -62,6 +62,7 @@ class DcmdMBeanRunner {
         "com.sun.management:type=DiagnosticCommand";
 
     public static void main(String[] args) throws Exception {
+        java.net.NetworkInterface.getNetworkInterfaces();
         MBeanServer mbs = ManagementFactory.getPlatformMBeanServer();
         JMXServiceURL url = new JMXServiceURL("rmi", null, 0);
         JMXConnectorServer cs = null;
[2]
--- ProcessLog ---
cmd: /disk/openjdk/upstream-sources/git/jdk-jdk/./build/linux-x86_64-server-release/images/jdk/bin/java -cp /disk/openjdk/upstream-sources/git/jdk-jdk/JTwork/classes/com/sun/management/DiagnosticCommandMBean/DcmdMBeanTestCheckJni.d:/disk/openjdk/upstream-sources/git/jdk-jdk/test/jdk/com/sun/management/DiagnosticCommandMBean:/disk/openjdk/upstream-sources/git/jdk-jdk/JTwork/classes/test/lib:/disk/openjdk/upstream-sources/git/jdk-jdk/test/lib:/disk/openjdk/upstream-sources/jtreg-5.1-b01/lib/javatest.jar:/disk/openjdk/upstream-sources/jtreg-5.1-b01/lib/jtreg.jar -Xcheck:jni DcmdMBeanRunner
exitvalue: 0
stderr:
stdout: WARNING: JNI local refs: 33, exceeds capacity: 32
        at java.net.NetworkInterface.getAll(java.base at 17-internal/Native Method)
        at java.net.NetworkInterface.getNetworkInterfaces(java.base at 17-internal/NetworkInterface.java:351)
        at DcmdMBeanRunner.main(DcmdMBeanTestCheckJni.java:65)
DiagnosticCommand MBean: com.sun.management:type=DiagnosticCommand
DcmdMBeanRunner COMPLETE

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

Commit messages:
 - 8260378: [TESTBUG] DcmdMBeanTestCheckJni.java reports false positive

Changes: https://git.openjdk.java.net/jdk/pull/2234/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=2234&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8260378
  Stats: 3 lines in 2 files changed: 1 ins; 1 del; 1 mod
  Patch: https://git.openjdk.java.net/jdk/pull/2234.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/2234/head:pull/2234

PR: https://git.openjdk.java.net/jdk/pull/2234


More information about the serviceability-dev mailing list