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

TEST_BUG: some errors related to RegTest-test EmbeddedURLCallback.java

XMLWordPrintable

    • x86
    • windows



      Name: asR10013 Date: 12/05/2002


      Filed By : J2SE-SQA [###@###.###
      JDK : JDK1.4.2-b08
      Testbase : RegTest-test
      Platform[s] : Windows ME
      Falling test[s]:
              java/net/Authenticator/B4769350.java

      RegTest-test java/net/Authenticator/B4769350.java test hangs on our Windows ME machine.
      Such a behaviour is caused by the following circumstances:
      Regression test base for Mantis b08 contains the new file EmbeddedURLCallback.java containing
      the following bug in it:

          public void request (HttpTransaction msg) {
              URI uri = msg.getRequestURI();
              Request req = (Request) requests.get (uri);

      ...

              req.next();

              if (req.finished()) {
                  requests.remove (req);
              }
          }

      The requests map uses URIs as keys but remove is called for req.
      As a result, the server generates warnings on subsequent requests and does not handle it appropriately.

      Clients of java/net/Authenticator/B4769350.java sometimes produces more than two requests, but this is another issue.

      After I had changed the code as follows:

      requests.remove (uri);

      The test stopped hanging and produced sensible information meaning that all clients (c1, c2, c3, c4) were authenticated and retrived 'Hello's but some of them
      sent more than two requests:

      java.lang.RuntimeException: Authenticator was called 6 times. Should be 2
              at B4769350.except(B4769350.java:216)
              at B4769350.doServerTests(B4769350.java:138)
              at B4769350.main(B4769350.java:196)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
              at java.lang.reflect.Method.invoke(Method.java:324)
              at com.sun.javatest.regtest.MainWrapper$MainThread.run(MainWrapper.java:82)
              at java.lang.Thread.run(Thread.java:536)

      JavaTest Message: Test threw exception: java.lang.RuntimeException: Authenticator was called 6 times. Should be 2




      It also worth to apply the following fixes in sun/net/httptest/HttpServer.java:

      private String readLine (InputStream is) throws IOException {
      ...

      return new String (b, 0, l); // was "return new String (b)" which returned a large string padded with zeroes.
      }

      Test source location:
      =====================
      /java/re/jdk/1.4.2/promoted/latest/ws/j2se/test/java/net/Authenticator/B4769350.java

      jtr file location:
      ==================
      /net/jtgb4u4c.sfbay/export/sail15/results/mantis/b08/regtest/win32/winme_-client_linux-18/workDir/test/java/net/Authenticator/B4769350.jtr

      How to reproduce:
      =================
      Run the following script (you may need to change its variables)
       
      --- script start ---
      #!/bin/sh

      RESULT_DIR=`pwd`
      WORK_DIR=$RESULT_DIR/workDir/test
      REPORT_DIR=$RESULT_DIR/reportDir
      JT_HOME="h:/java/jct"
      JAVA_HOME="h:/java/jdk1.4.2/win32"
      TEST_BASE_PATH="h:/java/regtest/test"

      TESTWITH=$JAVA_HOME
      TESTJAVA=$JAVA_HOME

      JTOPTS="-client"
      TESTVMOPTS="-client"

      CLASSPATH="$JT_HOME/classes;$JT_HOME/lib/javatest.jar;$JT_HOME/lib/jtreg.jar"

      export JAVA_HOME
      export JT_HOME
      export TESTWITH
      export CLASSPATH

      mkdir -p $WORK_DIR/scratch 2>&1
      mkdir -p $WORK_DIR/jtData 2>&1
      mkdir -p $REPORT_DIR 2>&1

      #rm $WORK_DIR/jtData/ResultCache.jtw 2>&1

      cd $WORK_DIR/scratch

      $JAVA_HOME/bin/java -cp $CLASSPATH $JTOPTS -DenvVars=TESTJAVAHOME=$JAVA_HOME,TESTVMOPTS=$TESTVMOPTS,DISPLAY=:0,windir=$windir,PATH=${SHELL%/*},TZ=,LC_ALL=en_US,LC_CTYPE=en_US,LANG=en_US,LPDEST= -DDISPLAY=:0 -DlocalHost="linux-18" -Dprogram=jtreg com.sun.javatest.regtest.Main -a -v default -batch -params -w "$WORK_DIR" -r "$REPORT_DIR" -t "$TEST_BASE_PATH" "$TEST_BASE_PATH/java/net/Authenticator/B4769350.java"

      --- script end ---

      Test output (jtr part):
      =======================
      ----------System.out:(8/291)----------
      Server: listening on port: 2990
      Doing Server tests
      Authenticator called: realm1
      HelloAuthenticator called: realm2
      Authenticator called: realm1
      HelloAuthenticator called: realm2
      *** Warning. No command to run. Ignoring request ***
      *** Warning. No command to run. Ignoring request ***
      ----------System.err:(0/0)----------
      result: Failed. Execution failed: Program `k:/jdk1.4.2/win32 in\java' interrupted! (timed out?)


      test result: Failed. Execution failed: Program `k:/jdk1.4.2/win32 in\java' interrupted! (timed out?)


      Specific machine info:
      ======================
      Hostname: linux-18
      OS: Windows ME



      ======================================================================

            michaelm Michael McMahon
            alssunw Als Als (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: