Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8253752

jdk/test/sun/management/jmxremote/bootstrap/RmiBootstrapTest.sh fails randomly

XMLWordPrintable

    • b01

      $ jtreg -va jdk/test/sun/management/jmxremote/bootstrap/RmiBootstrapTest.sh (fails 1/100)

      *** Testing configuration (port=36587): /home/hedongbo/myprojects/testJDK/JVM/test/testsuite/openjdk/test_result-RmiBootstrapTest/jtwork-42/classes/sun/management/jmxremote/bootstrap/management_test06_ok.properties
      ***
      PasswordFileName: /home/hedongbo/myprojects/testJDK/JVM/test/testsuite/openjdk/test_result-RmiBootstrapTest/jtwork-42/classes/sun/management/jmxremote/bootstrap/jmxremote_test06_ok.password
      accessFileName: /home/hedongbo/myprojects/openJDK/bak/jdk8u-dev/build/linux-x86_64-normal-server-release/images/j2sdk-image/jre/lib/management/jmxremote.access
      Communication succeeded as expected for {controlRole, R&D}: found 1MBean
      Communication succeeded as expected for {monitorRole, QED}: found 1MBean
      Connection failed as expected for {bad.user, R&D}: java.lang.SecurityException: Authentication failed! Invalid username or password
      Connection failed as expected for {measure, bad.password}: java.lang.SecurityException: Authentication failed! Invalid username or password
      Configuration /home/hedongbo/myprojects/testJDK/JVM/test/testsuite/openjdk/test_result-RmiBootstrapTest/jtwork-42/classes/sun/management/jmxremote/bootstrap/management_test06_ok.properties successfully tested
      ***
      *** Testing configuration (port=36588): /home/hedongbo/myprojects/testJDK/JVM/test/testsuite/openjdk/test_result-RmiBootstrapTest/jtwork-42/classes/sun/management/jmxremote/bootstrap/management_test02_ok.properties
      ***
      ***
      *** Testing configuration (port=36589): /home/hedongbo/myprojects/testJDK/JVM/test/testsuite/openjdk/test_result-RmiBootstrapTest/jtwork-42/classes/sun/management/jmxremote/bootstrap/management_test01_ok.properties
      ***
      Test Failed: 4
      STDERR:
      rerun:
      cd /home/hedongbo/myprojects/testJDK/JVM/test/testsuite/openjdk/test_result-RmiBootstrapTest/jtwork-42/scratch && \
      HOME=/home/hedongbo \
      LANG=en_US.UTF-8 \
      LC_CTYPE=zh_CN.UTF-8 \
      PATH=/bin:/usr/bin \
      TESTSRC=/home/hedongbo/myprojects/testJDK/JVM/test/testsuite/openjdk/jdk8u/jdk/test/sun/management/jmxremote/bootstrap \
      TESTSRCPATH=/home/hedongbo/myprojects/testJDK/JVM/test/testsuite/openjdk/jdk8u/jdk/test/sun/management/jmxremote/bootstrap \
      TESTCLASSES=/home/hedongbo/myprojects/testJDK/JVM/test/testsuite/openjdk/test_result-RmiBootstrapTest/jtwork-42/classes/sun/management/jmxremote/bootstrap \
      TESTCLASSPATH=/home/hedongbo/myprojects/testJDK/JVM/test/testsuite/openjdk/test_result-RmiBootstrapTest/jtwork-42/classes/sun/management/jmxremote/bootstrap \
      COMPILEJAVA=/home/hedongbo/myprojects/openJDK/bak/jdk8u-dev/build/linux-x86_64-normal-server-release/images/j2sdk-image \
      TESTJAVA=/home/hedongbo/myprojects/openJDK/bak/jdk8u-dev/build/linux-x86_64-normal-server-release/images/j2sdk-image \
      TESTVMOPTS= \
      TESTTOOLVMOPTS= \
      TESTJAVACOPTS= \
      TESTJAVAOPTS= \
      TESTTIMEOUTFACTOR=10.0 \
          sh \
              /home/hedongbo/myprojects/testJDK/JVM/test/testsuite/openjdk/jdk8u/jdk/test/sun/management/jmxremote/bootstrap/RmiBootstrapTest.sh

      TEST RESULT: Failed. Execution failed: exit code 20
      --------------------------------------------------
      Test results: failed: 1
      Results written to /home/hedongbo/myprojects/testJDK/JVM/test/testsuite/openjdk/test_result-RmiBootstrapTest/jtwork-42

      I think the reason for the error is in the following use case, the increment variable of the inner loop should be j
      // jdk/test/sun/management/jmxremote/bootstrap/RmiBootstrapTest.java
       public void runok() {
              final String portStr = System.getProperty("rmi.port",null);
              final int port = portStr != null ?
                                      Integer.parseInt(portStr) : basePort;
              final File[] conf = findConfigurationFilesOk();
              if ((conf == null)||(conf.length == 0))
                  throw new RuntimeException("No configuration found");

              String errStr = null;
              for (int i=0;i<conf.length;i++) { // conf.length = 4
                  for (int j = 0; j < PORT_TEST_LEN; i++) { // j should be here
                      try {
                          errStr = testConfiguration(conf[i],port+testPort++); // ArrayIndexOutOfBoundsException is thrown when i = 4
                          break;
                      } catch (BindException e) {
                          // port conflict; try another port
                      }
                  }
                  if (errStr != null) {
                      throw new RuntimeException(errStr);
                  }
              }



            dongbohe Dongbo He
            dongbohe Dongbo He
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: