21 * questions.
22 */
23
24 import java.io.BufferedReader;
25 import java.io.File;
26 import java.io.FileInputStream;
27 import java.io.InputStreamReader;
28 import java.util.regex.Pattern;
29
30 import jdk.test.lib.process.OutputAnalyzer;
31 import jdk.test.lib.Platform;
32 import jdk.test.lib.process.ProcessTools;
33
34 /*
35 * @test
36 * @bug 8166944
37 * @summary Hanging Error Reporting steps may lead to torn error logs
38 * @modules java.base/jdk.internal.misc
39 * @library /test/lib
40 * @requires (vm.debug == true) & (os.family != "windows")
41 * @author Thomas Stuefe (SAP)
42 */
43
44 public class TimeoutInErrorHandlingTest {
45
46 public static final boolean verbose = System.getProperty("verbose") != null;
47 // 16 seconds for hs_err generation timeout = 4 seconds per step timeout
48 public static final int ERROR_LOG_TIMEOUT = 16;
49
50 public static void main(String[] args) throws Exception {
51
52 int error_log_timeout = ERROR_LOG_TIMEOUT;
53 if ("SunOS".equals(System.getProperty("os.name"))) {
54 // Give Solaris machines 3X as much time:
55 error_log_timeout *= 3;
56 }
57
58 /* Start the VM and let it crash. Specify TestUnresponsiveErrorHandler which will
59 * let five subsequent error reporting steps hang. The Timeout handling triggered
60 * by the WatcherThread should kick in and interrupt those steps. In theory, the
|
21 * questions.
22 */
23
24 import java.io.BufferedReader;
25 import java.io.File;
26 import java.io.FileInputStream;
27 import java.io.InputStreamReader;
28 import java.util.regex.Pattern;
29
30 import jdk.test.lib.process.OutputAnalyzer;
31 import jdk.test.lib.Platform;
32 import jdk.test.lib.process.ProcessTools;
33
34 /*
35 * @test
36 * @bug 8166944
37 * @summary Hanging Error Reporting steps may lead to torn error logs
38 * @modules java.base/jdk.internal.misc
39 * @library /test/lib
40 * @requires (vm.debug == true) & (os.family != "windows")
41 * @run driver TimeoutInErrorHandlingTest
42 * @author Thomas Stuefe (SAP)
43 */
44
45 public class TimeoutInErrorHandlingTest {
46
47 public static final boolean verbose = System.getProperty("verbose") != null;
48 // 16 seconds for hs_err generation timeout = 4 seconds per step timeout
49 public static final int ERROR_LOG_TIMEOUT = 16;
50
51 public static void main(String[] args) throws Exception {
52
53 int error_log_timeout = ERROR_LOG_TIMEOUT;
54 if ("SunOS".equals(System.getProperty("os.name"))) {
55 // Give Solaris machines 3X as much time:
56 error_log_timeout *= 3;
57 }
58
59 /* Start the VM and let it crash. Specify TestUnresponsiveErrorHandler which will
60 * let five subsequent error reporting steps hang. The Timeout handling triggered
61 * by the WatcherThread should kick in and interrupt those steps. In theory, the
|