|
38 | 38 | import com.oracle.coherence.common.base.Logger; |
39 | 39 |
|
40 | 40 | import com.oracle.coherence.common.collections.ConcurrentHashMap; |
| 41 | +import com.oracle.coherence.common.util.Threads; |
| 42 | +import com.oracle.coherence.testing.junit.ThreadDumpOnTimeoutRule; |
| 43 | + |
41 | 44 | import com.tangosol.internal.net.topic.impl.paged.PagedTopicPublisher; |
42 | 45 | import com.tangosol.io.ExternalizableLite; |
43 | 46 |
|
@@ -857,13 +860,26 @@ public int hashCode() |
857 | 860 | @ClassRule |
858 | 861 | public static TestLogs s_testLogs = new TestLogs(TopicsRecoveryTests.class); |
859 | 862 |
|
| 863 | + private static CoherenceCluster s_storageCluster; |
| 864 | + |
| 865 | + /** |
| 866 | + * A JUnit rule that will cause the test to fail if it runs too long. |
| 867 | + * A thread dump will be generated on failure. |
| 868 | + */ |
| 869 | + @ClassRule |
| 870 | + public static final ThreadDumpOnTimeoutRule timeout = ThreadDumpOnTimeoutRule.after(30, TimeUnit.MINUTES, () -> |
| 871 | + s_storageCluster.forEach(member -> member.invoke(() -> |
| 872 | + { |
| 873 | + System.err.println(Threads.getThreadDump(true)); |
| 874 | + return null; |
| 875 | + }))); |
| 876 | + |
860 | 877 | private static final OptionsByType s_options = OptionsByType.of( |
861 | 878 | SystemProperty.of("coherence.guard.timeout", 60000), |
862 | 879 | CacheConfig.of("simple-persistence-bdb-cache-config.xml"), |
863 | 880 | OperationalOverride.of("common-tangosol-coherence-override.xml"), |
864 | 881 | SystemProperty.of("coherence.distributed.partitioncount", "13")); |
865 | 882 |
|
866 | | - private static CoherenceCluster s_storageCluster; |
867 | 883 |
|
868 | 884 | private static Coherence s_coherence; |
869 | 885 |
|
|
0 commit comments