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

java/nio/file/attribute/BasicFileAttributeView/UnixSocketFile hangs when "nc" does not accept "-U"

XMLWordPrintable

    • b17

        Happened with me on older Debian. There:

        $ nc -lU
        nc: invalid option -- 'U'
        nc -h for help

        Which leads to:

        $ make run-test TEST=java/nio/file/attribute/BasicFileAttributeView/UnixSocketFile.java
        ...
        TEST RESULT: Error. Agent error: java.lang.Exception: Agent 1 timed out with a timeout of 480 seconds; check console log for any additional details


        This fixes the test:

        diff -r 8de62c4af8c7 test/jdk/java/nio/file/attribute/BasicFileAttributeView/UnixSocketFile.java
        --- a/test/jdk/java/nio/file/attribute/BasicFileAttributeView/UnixSocketFile.java Fri Apr 12 13:35:23 2019 +0800
        +++ b/test/jdk/java/nio/file/attribute/BasicFileAttributeView/UnixSocketFile.java Fri Apr 12 15:17:01 2019 +0200
        @@ -61,6 +61,14 @@
                     return;
                 }
         
        + // Verify that 'nc' accepts '-U' for Unix domain sockets.
        + // Skip the test if it is not.
        + Process procHelp = Runtime.getRuntime().exec(CMD_BASE + " -h");
        + if (procHelp.waitFor() != 0) {
        + System.err.println("Netcat does not accept required options; skipping test.");
        + return;
        + }
        +
                 // Create a new sub-directory of the nominal test directory in which
                 // 'nc' will create the socket file.
                 String testSubDir = System.getProperty("test.dir", ".")


              shade Aleksey Shipilev
              shade Aleksey Shipilev
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: