test/jdk/java/net/ServerSocket/AcceptCauseFileDescriptorLeak.java
author chegar
Thu, 17 Oct 2019 20:54:25 +0100
branchdatagramsocketimpl-branch
changeset 58679 9c3209ff7550
parent 58678 9cf78a70fa4f
parent 57686 70f5cbb711a9
permissions -rw-r--r--
datagramsocketimpl-branch: merge with default
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
54841
43439afaab4a 8223638: Replace wildcard address with loopback or local host in tests - part 6
aefimov
parents: 47216
diff changeset
     2
 * Copyright (c) 2006, 2019, Oracle and/or its affiliates. All rights reserved.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
90ce3da70b43 Initial load
duke
parents:
diff changeset
     7
 * published by the Free Software Foundation.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
 * accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
 *
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 5159
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 5159
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 5159
diff changeset
    21
 * questions.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    22
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    23
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
/*
5159
55d38eeb1e33 6935233: java/net/ServerSocket/AcceptCauseFileDescriptorLeak.java fails with modules build
chegar
parents: 2
diff changeset
    25
 * author Edward Wang
42449
ec908b8eb5cc 8043838: Test java/net/ServerSocket/AcceptCauseFileDescriptorLeak.java failed intermittently in nightly
xiaofeya
parents: 7668
diff changeset
    26
 *
ec908b8eb5cc 8043838: Test java/net/ServerSocket/AcceptCauseFileDescriptorLeak.java failed intermittently in nightly
xiaofeya
parents: 7668
diff changeset
    27
 * @test
ec908b8eb5cc 8043838: Test java/net/ServerSocket/AcceptCauseFileDescriptorLeak.java failed intermittently in nightly
xiaofeya
parents: 7668
diff changeset
    28
 * @bug 6368984
57686
70f5cbb711a9 8225430: Replace wildcard address with loopback or local host in tests - part 14
aefimov
parents: 55102
diff changeset
    29
 * @key intermittent
42449
ec908b8eb5cc 8043838: Test java/net/ServerSocket/AcceptCauseFileDescriptorLeak.java failed intermittently in nightly
xiaofeya
parents: 7668
diff changeset
    30
 * @summary Configuring unconnected Socket before passing to implAccept
57686
70f5cbb711a9 8225430: Replace wildcard address with loopback or local host in tests - part 14
aefimov
parents: 55102
diff changeset
    31
 *          can cause fd leak.
70f5cbb711a9 8225430: Replace wildcard address with loopback or local host in tests - part 14
aefimov
parents: 55102
diff changeset
    32
 *          This test may fail intermittently if foreign processes will
70f5cbb711a9 8225430: Replace wildcard address with loopback or local host in tests - part 14
aefimov
parents: 55102
diff changeset
    33
 *          try to establish connection to the test server socket.
42449
ec908b8eb5cc 8043838: Test java/net/ServerSocket/AcceptCauseFileDescriptorLeak.java failed intermittently in nightly
xiaofeya
parents: 7668
diff changeset
    34
 * @requires (os.family != "windows")
ec908b8eb5cc 8043838: Test java/net/ServerSocket/AcceptCauseFileDescriptorLeak.java failed intermittently in nightly
xiaofeya
parents: 7668
diff changeset
    35
 * @library /test/lib
45467
99c87a16a8e4 8181761: add explicit @build actions for jdk.test.lib classes in all :tier2 tests
iignatyev
parents: 42449
diff changeset
    36
 * @build jdk.test.lib.Utils
99c87a16a8e4 8181761: add explicit @build actions for jdk.test.lib classes in all :tier2 tests
iignatyev
parents: 42449
diff changeset
    37
 *        jdk.test.lib.Asserts
99c87a16a8e4 8181761: add explicit @build actions for jdk.test.lib classes in all :tier2 tests
iignatyev
parents: 42449
diff changeset
    38
 *        jdk.test.lib.JDKToolFinder
99c87a16a8e4 8181761: add explicit @build actions for jdk.test.lib classes in all :tier2 tests
iignatyev
parents: 42449
diff changeset
    39
 *        jdk.test.lib.JDKToolLauncher
99c87a16a8e4 8181761: add explicit @build actions for jdk.test.lib classes in all :tier2 tests
iignatyev
parents: 42449
diff changeset
    40
 *        jdk.test.lib.Platform
99c87a16a8e4 8181761: add explicit @build actions for jdk.test.lib classes in all :tier2 tests
iignatyev
parents: 42449
diff changeset
    41
 *        jdk.test.lib.process.*
42449
ec908b8eb5cc 8043838: Test java/net/ServerSocket/AcceptCauseFileDescriptorLeak.java failed intermittently in nightly
xiaofeya
parents: 7668
diff changeset
    42
 *        AcceptCauseFileDescriptorLeak
ec908b8eb5cc 8043838: Test java/net/ServerSocket/AcceptCauseFileDescriptorLeak.java failed intermittently in nightly
xiaofeya
parents: 7668
diff changeset
    43
 * @run main/othervm AcceptCauseFileDescriptorLeak root
55102
59567035d279 8221481: Reimplement the Legacy Socket API
alanb
parents: 54841
diff changeset
    44
 * @run main/othervm -Djdk.net.usePlainSocketImpl AcceptCauseFileDescriptorLeak root
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
5159
55d38eeb1e33 6935233: java/net/ServerSocket/AcceptCauseFileDescriptorLeak.java fails with modules build
chegar
parents: 2
diff changeset
    47
import java.io.IOException;
54841
43439afaab4a 8223638: Replace wildcard address with loopback or local host in tests - part 6
aefimov
parents: 47216
diff changeset
    48
import java.net.InetAddress;
57686
70f5cbb711a9 8225430: Replace wildcard address with loopback or local host in tests - part 14
aefimov
parents: 55102
diff changeset
    49
import java.net.InetSocketAddress;
5159
55d38eeb1e33 6935233: java/net/ServerSocket/AcceptCauseFileDescriptorLeak.java fails with modules build
chegar
parents: 2
diff changeset
    50
import java.net.ServerSocket;
55d38eeb1e33 6935233: java/net/ServerSocket/AcceptCauseFileDescriptorLeak.java fails with modules build
chegar
parents: 2
diff changeset
    51
import java.net.Socket;
42449
ec908b8eb5cc 8043838: Test java/net/ServerSocket/AcceptCauseFileDescriptorLeak.java failed intermittently in nightly
xiaofeya
parents: 7668
diff changeset
    52
import java.util.List;
ec908b8eb5cc 8043838: Test java/net/ServerSocket/AcceptCauseFileDescriptorLeak.java failed intermittently in nightly
xiaofeya
parents: 7668
diff changeset
    53
ec908b8eb5cc 8043838: Test java/net/ServerSocket/AcceptCauseFileDescriptorLeak.java failed intermittently in nightly
xiaofeya
parents: 7668
diff changeset
    54
import jdk.test.lib.JDKToolFinder;
ec908b8eb5cc 8043838: Test java/net/ServerSocket/AcceptCauseFileDescriptorLeak.java failed intermittently in nightly
xiaofeya
parents: 7668
diff changeset
    55
import jdk.test.lib.process.OutputAnalyzer;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
public class AcceptCauseFileDescriptorLeak {
5159
55d38eeb1e33 6935233: java/net/ServerSocket/AcceptCauseFileDescriptorLeak.java fails with modules build
chegar
parents: 2
diff changeset
    58
    private static final int REPS = 2048;
42449
ec908b8eb5cc 8043838: Test java/net/ServerSocket/AcceptCauseFileDescriptorLeak.java failed intermittently in nightly
xiaofeya
parents: 7668
diff changeset
    59
    private static final int THRESHOLD = 1024;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
    public static void main(String[] args) throws Exception {
42449
ec908b8eb5cc 8043838: Test java/net/ServerSocket/AcceptCauseFileDescriptorLeak.java failed intermittently in nightly
xiaofeya
parents: 7668
diff changeset
    62
        if (args.length != 0) {
ec908b8eb5cc 8043838: Test java/net/ServerSocket/AcceptCauseFileDescriptorLeak.java failed intermittently in nightly
xiaofeya
parents: 7668
diff changeset
    63
            OutputAnalyzer analyzer = execCmd("ulimit -n -H");
ec908b8eb5cc 8043838: Test java/net/ServerSocket/AcceptCauseFileDescriptorLeak.java failed intermittently in nightly
xiaofeya
parents: 7668
diff changeset
    64
            String output = analyzer.getOutput();
ec908b8eb5cc 8043838: Test java/net/ServerSocket/AcceptCauseFileDescriptorLeak.java failed intermittently in nightly
xiaofeya
parents: 7668
diff changeset
    65
            if (output == null || output.length() == 0) {
ec908b8eb5cc 8043838: Test java/net/ServerSocket/AcceptCauseFileDescriptorLeak.java failed intermittently in nightly
xiaofeya
parents: 7668
diff changeset
    66
                throw new RuntimeException("\"ulimit -n -H\" output nothing"
ec908b8eb5cc 8043838: Test java/net/ServerSocket/AcceptCauseFileDescriptorLeak.java failed intermittently in nightly
xiaofeya
parents: 7668
diff changeset
    67
                        + " and its exit code is " + analyzer.getExitValue());
ec908b8eb5cc 8043838: Test java/net/ServerSocket/AcceptCauseFileDescriptorLeak.java failed intermittently in nightly
xiaofeya
parents: 7668
diff changeset
    68
            } else {
ec908b8eb5cc 8043838: Test java/net/ServerSocket/AcceptCauseFileDescriptorLeak.java failed intermittently in nightly
xiaofeya
parents: 7668
diff changeset
    69
                output = output.trim();
ec908b8eb5cc 8043838: Test java/net/ServerSocket/AcceptCauseFileDescriptorLeak.java failed intermittently in nightly
xiaofeya
parents: 7668
diff changeset
    70
                // Set max open file descriptors to 1024
ec908b8eb5cc 8043838: Test java/net/ServerSocket/AcceptCauseFileDescriptorLeak.java failed intermittently in nightly
xiaofeya
parents: 7668
diff changeset
    71
                // if it is unlimited or greater than 1024,
ec908b8eb5cc 8043838: Test java/net/ServerSocket/AcceptCauseFileDescriptorLeak.java failed intermittently in nightly
xiaofeya
parents: 7668
diff changeset
    72
                // otherwise just do test directly
ec908b8eb5cc 8043838: Test java/net/ServerSocket/AcceptCauseFileDescriptorLeak.java failed intermittently in nightly
xiaofeya
parents: 7668
diff changeset
    73
                if ("unlimited".equals(output)
ec908b8eb5cc 8043838: Test java/net/ServerSocket/AcceptCauseFileDescriptorLeak.java failed intermittently in nightly
xiaofeya
parents: 7668
diff changeset
    74
                        || Integer.valueOf(output) > THRESHOLD) {
ec908b8eb5cc 8043838: Test java/net/ServerSocket/AcceptCauseFileDescriptorLeak.java failed intermittently in nightly
xiaofeya
parents: 7668
diff changeset
    75
                    analyzer = execCmd("ulimit -n " + THRESHOLD + "; "
ec908b8eb5cc 8043838: Test java/net/ServerSocket/AcceptCauseFileDescriptorLeak.java failed intermittently in nightly
xiaofeya
parents: 7668
diff changeset
    76
                            + composeJavaTestStr());
ec908b8eb5cc 8043838: Test java/net/ServerSocket/AcceptCauseFileDescriptorLeak.java failed intermittently in nightly
xiaofeya
parents: 7668
diff changeset
    77
                    System.out.println("Output: ["
ec908b8eb5cc 8043838: Test java/net/ServerSocket/AcceptCauseFileDescriptorLeak.java failed intermittently in nightly
xiaofeya
parents: 7668
diff changeset
    78
                            + analyzer.getOutput() + "]");
ec908b8eb5cc 8043838: Test java/net/ServerSocket/AcceptCauseFileDescriptorLeak.java failed intermittently in nightly
xiaofeya
parents: 7668
diff changeset
    79
                    int rc = analyzer.getExitValue();
ec908b8eb5cc 8043838: Test java/net/ServerSocket/AcceptCauseFileDescriptorLeak.java failed intermittently in nightly
xiaofeya
parents: 7668
diff changeset
    80
                    if (rc != 0) {
ec908b8eb5cc 8043838: Test java/net/ServerSocket/AcceptCauseFileDescriptorLeak.java failed intermittently in nightly
xiaofeya
parents: 7668
diff changeset
    81
                        throw new RuntimeException(
ec908b8eb5cc 8043838: Test java/net/ServerSocket/AcceptCauseFileDescriptorLeak.java failed intermittently in nightly
xiaofeya
parents: 7668
diff changeset
    82
                                "Unexpected exit code: " + rc);
ec908b8eb5cc 8043838: Test java/net/ServerSocket/AcceptCauseFileDescriptorLeak.java failed intermittently in nightly
xiaofeya
parents: 7668
diff changeset
    83
                    }
ec908b8eb5cc 8043838: Test java/net/ServerSocket/AcceptCauseFileDescriptorLeak.java failed intermittently in nightly
xiaofeya
parents: 7668
diff changeset
    84
                    return;
ec908b8eb5cc 8043838: Test java/net/ServerSocket/AcceptCauseFileDescriptorLeak.java failed intermittently in nightly
xiaofeya
parents: 7668
diff changeset
    85
                }
ec908b8eb5cc 8043838: Test java/net/ServerSocket/AcceptCauseFileDescriptorLeak.java failed intermittently in nightly
xiaofeya
parents: 7668
diff changeset
    86
            }
ec908b8eb5cc 8043838: Test java/net/ServerSocket/AcceptCauseFileDescriptorLeak.java failed intermittently in nightly
xiaofeya
parents: 7668
diff changeset
    87
        }
ec908b8eb5cc 8043838: Test java/net/ServerSocket/AcceptCauseFileDescriptorLeak.java failed intermittently in nightly
xiaofeya
parents: 7668
diff changeset
    88
57686
70f5cbb711a9 8225430: Replace wildcard address with loopback or local host in tests - part 14
aefimov
parents: 55102
diff changeset
    89
        final ServerSocket ss = new ServerSocket() {
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
            public Socket accept() throws IOException {
42449
ec908b8eb5cc 8043838: Test java/net/ServerSocket/AcceptCauseFileDescriptorLeak.java failed intermittently in nightly
xiaofeya
parents: 7668
diff changeset
    91
                Socket s = new Socket() {
ec908b8eb5cc 8043838: Test java/net/ServerSocket/AcceptCauseFileDescriptorLeak.java failed intermittently in nightly
xiaofeya
parents: 7668
diff changeset
    92
                };
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
                s.setSoTimeout(10000);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
                implAccept(s);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
                return s;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
        };
57686
70f5cbb711a9 8225430: Replace wildcard address with loopback or local host in tests - part 14
aefimov
parents: 55102
diff changeset
    98
        ss.bind(new InetSocketAddress(InetAddress.getLoopbackAddress(), 0));
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
        Thread t = new Thread(new Runnable() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
            public void run() {
57686
70f5cbb711a9 8225430: Replace wildcard address with loopback or local host in tests - part 14
aefimov
parents: 55102
diff changeset
   101
                int repsCompleted = 0;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
                try {
57686
70f5cbb711a9 8225430: Replace wildcard address with loopback or local host in tests - part 14
aefimov
parents: 55102
diff changeset
   103
                    for (; repsCompleted < REPS; repsCompleted++) {
54841
43439afaab4a 8223638: Replace wildcard address with loopback or local host in tests - part 6
aefimov
parents: 47216
diff changeset
   104
                        (new Socket(InetAddress.getLoopbackAddress(), ss.getLocalPort())).close();
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
                    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
                } catch (IOException e) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
                    e.printStackTrace();
57686
70f5cbb711a9 8225430: Replace wildcard address with loopback or local host in tests - part 14
aefimov
parents: 55102
diff changeset
   108
                } finally {
70f5cbb711a9 8225430: Replace wildcard address with loopback or local host in tests - part 14
aefimov
parents: 55102
diff changeset
   109
                    System.out.println("Client iterations completed:" + repsCompleted);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
                }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
        });
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
        t.start();
57686
70f5cbb711a9 8225430: Replace wildcard address with loopback or local host in tests - part 14
aefimov
parents: 55102
diff changeset
   114
        int repsCompleted = 0;
42449
ec908b8eb5cc 8043838: Test java/net/ServerSocket/AcceptCauseFileDescriptorLeak.java failed intermittently in nightly
xiaofeya
parents: 7668
diff changeset
   115
        try {
57686
70f5cbb711a9 8225430: Replace wildcard address with loopback or local host in tests - part 14
aefimov
parents: 55102
diff changeset
   116
            for (; repsCompleted < REPS; repsCompleted++) {
42449
ec908b8eb5cc 8043838: Test java/net/ServerSocket/AcceptCauseFileDescriptorLeak.java failed intermittently in nightly
xiaofeya
parents: 7668
diff changeset
   117
                ss.accept().close();
ec908b8eb5cc 8043838: Test java/net/ServerSocket/AcceptCauseFileDescriptorLeak.java failed intermittently in nightly
xiaofeya
parents: 7668
diff changeset
   118
            }
ec908b8eb5cc 8043838: Test java/net/ServerSocket/AcceptCauseFileDescriptorLeak.java failed intermittently in nightly
xiaofeya
parents: 7668
diff changeset
   119
        } finally {
57686
70f5cbb711a9 8225430: Replace wildcard address with loopback or local host in tests - part 14
aefimov
parents: 55102
diff changeset
   120
            System.out.println("Server iterations completed:" + repsCompleted);
42449
ec908b8eb5cc 8043838: Test java/net/ServerSocket/AcceptCauseFileDescriptorLeak.java failed intermittently in nightly
xiaofeya
parents: 7668
diff changeset
   121
            ss.close();
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
        t.join();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
    }
42449
ec908b8eb5cc 8043838: Test java/net/ServerSocket/AcceptCauseFileDescriptorLeak.java failed intermittently in nightly
xiaofeya
parents: 7668
diff changeset
   125
ec908b8eb5cc 8043838: Test java/net/ServerSocket/AcceptCauseFileDescriptorLeak.java failed intermittently in nightly
xiaofeya
parents: 7668
diff changeset
   126
    /**
ec908b8eb5cc 8043838: Test java/net/ServerSocket/AcceptCauseFileDescriptorLeak.java failed intermittently in nightly
xiaofeya
parents: 7668
diff changeset
   127
     * Execute command with shell
ec908b8eb5cc 8043838: Test java/net/ServerSocket/AcceptCauseFileDescriptorLeak.java failed intermittently in nightly
xiaofeya
parents: 7668
diff changeset
   128
     *
ec908b8eb5cc 8043838: Test java/net/ServerSocket/AcceptCauseFileDescriptorLeak.java failed intermittently in nightly
xiaofeya
parents: 7668
diff changeset
   129
     * @param  command
ec908b8eb5cc 8043838: Test java/net/ServerSocket/AcceptCauseFileDescriptorLeak.java failed intermittently in nightly
xiaofeya
parents: 7668
diff changeset
   130
     * @return OutputAnalyzer
ec908b8eb5cc 8043838: Test java/net/ServerSocket/AcceptCauseFileDescriptorLeak.java failed intermittently in nightly
xiaofeya
parents: 7668
diff changeset
   131
     * @throws IOException
ec908b8eb5cc 8043838: Test java/net/ServerSocket/AcceptCauseFileDescriptorLeak.java failed intermittently in nightly
xiaofeya
parents: 7668
diff changeset
   132
     */
ec908b8eb5cc 8043838: Test java/net/ServerSocket/AcceptCauseFileDescriptorLeak.java failed intermittently in nightly
xiaofeya
parents: 7668
diff changeset
   133
    static OutputAnalyzer execCmd(String command) throws IOException {
ec908b8eb5cc 8043838: Test java/net/ServerSocket/AcceptCauseFileDescriptorLeak.java failed intermittently in nightly
xiaofeya
parents: 7668
diff changeset
   134
        List<String> cmd = List.of("sh", "-c", command);
ec908b8eb5cc 8043838: Test java/net/ServerSocket/AcceptCauseFileDescriptorLeak.java failed intermittently in nightly
xiaofeya
parents: 7668
diff changeset
   135
        System.out.println("Executing: " + cmd);
ec908b8eb5cc 8043838: Test java/net/ServerSocket/AcceptCauseFileDescriptorLeak.java failed intermittently in nightly
xiaofeya
parents: 7668
diff changeset
   136
        ProcessBuilder pb = new ProcessBuilder(cmd);
ec908b8eb5cc 8043838: Test java/net/ServerSocket/AcceptCauseFileDescriptorLeak.java failed intermittently in nightly
xiaofeya
parents: 7668
diff changeset
   137
        return new OutputAnalyzer(pb.start());
ec908b8eb5cc 8043838: Test java/net/ServerSocket/AcceptCauseFileDescriptorLeak.java failed intermittently in nightly
xiaofeya
parents: 7668
diff changeset
   138
    }
ec908b8eb5cc 8043838: Test java/net/ServerSocket/AcceptCauseFileDescriptorLeak.java failed intermittently in nightly
xiaofeya
parents: 7668
diff changeset
   139
ec908b8eb5cc 8043838: Test java/net/ServerSocket/AcceptCauseFileDescriptorLeak.java failed intermittently in nightly
xiaofeya
parents: 7668
diff changeset
   140
    static String composeJavaTestStr() {
ec908b8eb5cc 8043838: Test java/net/ServerSocket/AcceptCauseFileDescriptorLeak.java failed intermittently in nightly
xiaofeya
parents: 7668
diff changeset
   141
        return JDKToolFinder.getTestJDKTool("java") + " "
ec908b8eb5cc 8043838: Test java/net/ServerSocket/AcceptCauseFileDescriptorLeak.java failed intermittently in nightly
xiaofeya
parents: 7668
diff changeset
   142
                + AcceptCauseFileDescriptorLeak.class.getName();
ec908b8eb5cc 8043838: Test java/net/ServerSocket/AcceptCauseFileDescriptorLeak.java failed intermittently in nightly
xiaofeya
parents: 7668
diff changeset
   143
    }
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
}
42449
ec908b8eb5cc 8043838: Test java/net/ServerSocket/AcceptCauseFileDescriptorLeak.java failed intermittently in nightly
xiaofeya
parents: 7668
diff changeset
   145