29 import java.security.ProtectionDomain;
30 import java.util.ArrayList;
31 import java.util.Collections;
32 import java.util.HashSet;
33 import java.util.List;
34 import java.util.Random;
35 import java.util.Set;
36 import java.util.concurrent.atomic.AtomicLong;
37 import java.util.logging.Level;
38 import java.util.logging.LogManager;
39 import java.util.logging.Logger;
40
41
42 /**
43 * @test
44 * @bug 8027670 8029281
45 * @summary Deadlock in drainLoggerRefQueueBounded / readConfiguration
46 * caused by synchronization issues in Logger and LogManager.
47 * @run main/othervm TestLogConfigurationDeadLockWithConf
48 * @author danielfuchs
49 */
50 // This test is a best effort to try & detect issues. The test itself will run
51 // for 8secs. This is usually sufficient to detect issues.
52 // However to get a greater confidence it is recommended to run this test in a loop:
53 // e.g. use something like:
54 // $ while jtreg -jdk:$JDK -verbose:all \
55 // test/java/util/logging/TestLogConfigurationDeadLockWithConf.java ; \
56 // do echo Running test again ; done
57 // and let it run for a few hours...
58 //
59 public class TestLogConfigurationDeadLockWithConf {
60
61 static volatile Exception thrown = null;
62 static volatile boolean goOn = true;
63
64 static final int READERS = 2;
65 static final int LOGGERS = 2;
66 static final long TIME = 4 * 1000; // 4 sec.
67 static final long STEP = 1 * 1000; // message every 1 sec.
68 static final int LCOUNT = 50; // 50 loggers created in a row...
|
29 import java.security.ProtectionDomain;
30 import java.util.ArrayList;
31 import java.util.Collections;
32 import java.util.HashSet;
33 import java.util.List;
34 import java.util.Random;
35 import java.util.Set;
36 import java.util.concurrent.atomic.AtomicLong;
37 import java.util.logging.Level;
38 import java.util.logging.LogManager;
39 import java.util.logging.Logger;
40
41
42 /**
43 * @test
44 * @bug 8027670 8029281
45 * @summary Deadlock in drainLoggerRefQueueBounded / readConfiguration
46 * caused by synchronization issues in Logger and LogManager.
47 * @run main/othervm TestLogConfigurationDeadLockWithConf
48 * @author danielfuchs
49 * @key randomness
50 */
51 // This test is a best effort to try & detect issues. The test itself will run
52 // for 8secs. This is usually sufficient to detect issues.
53 // However to get a greater confidence it is recommended to run this test in a loop:
54 // e.g. use something like:
55 // $ while jtreg -jdk:$JDK -verbose:all \
56 // test/java/util/logging/TestLogConfigurationDeadLockWithConf.java ; \
57 // do echo Running test again ; done
58 // and let it run for a few hours...
59 //
60 public class TestLogConfigurationDeadLockWithConf {
61
62 static volatile Exception thrown = null;
63 static volatile boolean goOn = true;
64
65 static final int READERS = 2;
66 static final int LOGGERS = 2;
67 static final long TIME = 4 * 1000; // 4 sec.
68 static final long STEP = 1 * 1000; // message every 1 sec.
69 static final int LCOUNT = 50; // 50 loggers created in a row...
|