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

HTTPSetAuthenticatorTest could be made more resilient

    XMLWordPrintable

Details

    • b13
    • sparc
    • solaris

    Backports

      Description

        Occasionally, a test server may receive traffic which does not come from its expected client. Ideally, servers should be resilient to that situation.
        HTTPSetAuthenticatorTest uses an experimental tunneling proxy that may simply fail and stop listening to requests if something unexpected happens:

        Tunnel: Waiting for client
        Tunnel: Client accepted
        Tunnel: Reading request line
        ----------System.err:(88/6668)----------
        WARNING: HttpsProxyTunnel is an experimental test class
        java.lang.StringIndexOutOfBoundsException: index -1,length 0
        at java.base/java.lang.String.checkIndex(String.java:3402)
        at java.base/java.lang.AbstractStringBuilder.codePointAt(AbstractStringBuilder.java:392)
        at java.base/java.lang.StringBuilder.codePointAt(StringBuilder.java:85)
        at HTTPTestServer$HttpsProxyTunnel.readLine(HTTPTestServer.java:1039)
        at HTTPTestServer$HttpsProxyTunnel.run(HTTPTestServer.java:1069)
        at java.base/java.lang.Thread.run(Thread.java:830)
        java.net.SocketException: Connection reset
        at java.base/java.net.SocketInputStream.read(SocketInputStream.java:184)
        at java.base/java.net.SocketInputStream.read(SocketInputStream.java:138)
        at java.base/java.net.Socket$SocketInputStream.read(Socket.java:910)
        at java.base/java.io.BufferedInputStream.fill(BufferedInputStream.java:252)
        at java.base/java.io.BufferedInputStream.read1(BufferedInputStream.java:292)
        at java.base/java.io.BufferedInputStream.read(BufferedInputStream.java:351)
        at java.base/sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:746)
        at java.base/sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:689)
        at java.base/sun.net.www.protocol.http.HttpURLConnection.doTunneling(HttpURLConnection.java:2074)
        at java.base/sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:169)
        at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1581)
        at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1509)
        at java.base/java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:527)
        at java.base/sun.net.www.protocol.https.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:303)
        at HTTPTestClient.connect(HTTPTestClient.java:51)
        at HTTPSetAuthenticatorTest.run(HTTPSetAuthenticatorTest.java:142)
        at HTTPTest.test(HTTPTest.java:202)
        at HTTPTest.test(HTTPTest.java:176)
        at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183)
        at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
        at java.base/java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.java:948)
        at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)
        at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
        at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)
        at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)
        at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
        at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:497)
        at HTTPTest.execute(HTTPTest.java:169)
        at HTTPSetAuthenticatorTest.main(HTTPSetAuthenticatorTest.java:97)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:567)
        at com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:127)
        at java.base/java.lang.Thread.run(Thread.java:830)

        Attachments

          Issue Links

            Activity

              People

                jpai Jaikiran Pai
                dfuchs Daniel Fuchs
                Votes:
                0 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved: