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

Re-evaluate the java/net/DatagramSocket/InterruptibleDatagramSocket.java test

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P4 P4
    • tbd
    • 19
    • core-libs

      The test/jdk/java/net/DatagramSocket/InterruptibleDatagramSocket.java test invokes the DatagramSocket.receive() method while a concurrent thread interrupts the thread that is doing the receive(). The test then expects an exception to be raised on the thread which was doing the receive().

      The test then asserts this exception. One part of that assertion is as follows:

       catch (SocketException e) {
          if ((e.getCause() instanceof ClosedByInterruptException) && interruptible) {
              System.out.println("Got expected ClosedByInterruptException: " + e);
          } else {
              throw e;
          }

      So the test expects the receive() may throw a SocketException whose cause is a ClosedByInterruptException. However, the DatagramSocket.receive() doesn't specify that the SocketException will have that cause.

      The test will have to be re-evaluated and maybe updated to fix this part.

            jpai Jaikiran Pai
            jpai Jaikiran Pai
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: