diff --git a/activemq-broker/src/test/java/org/apache/activemq/store/PListTestSupport.java b/activemq-broker/src/test/java/org/apache/activemq/store/PListTestSupport.java index 5b51656295..b40a6692cd 100644 --- a/activemq-broker/src/test/java/org/apache/activemq/store/PListTestSupport.java +++ b/activemq-broker/src/test/java/org/apache/activemq/store/PListTestSupport.java @@ -278,7 +278,7 @@ public abstract class PListTestSupport { executor.execute(new B()); executor.shutdown(); - boolean finishedInTime = executor.awaitTermination(5, TimeUnit.MINUTES); + boolean finishedInTime = executor.awaitTermination(10, TimeUnit.MINUTES); LOG.info("Tested completion finished in time? -> {}", finishedInTime ? "YES" : "NO"); assertTrue("no exceptions", exceptions.isEmpty()); diff --git a/activemq-kahadb-store/src/test/java/org/apache/activemq/store/kahadb/scheduler/AMQ7086Test.java b/activemq-kahadb-store/src/test/java/org/apache/activemq/store/kahadb/scheduler/AMQ7086Test.java index f66118e6be..459b433bef 100644 --- a/activemq-kahadb-store/src/test/java/org/apache/activemq/store/kahadb/scheduler/AMQ7086Test.java +++ b/activemq-kahadb-store/src/test/java/org/apache/activemq/store/kahadb/scheduler/AMQ7086Test.java @@ -42,7 +42,7 @@ public class AMQ7086Test { JobSchedulerStoreImpl jobSchedulerStore; KahaDBPersistenceAdapter kahaDBPersistenceAdapter; - @Test + @Test(timeout = 120000) public void testGcDoneAtStop() throws Exception { brokerService = createBroker(true); @@ -63,8 +63,14 @@ public class AMQ7086Test { brokerService.stop(); + while (verifyFilesOnDisk(jobDir) < 1) { + Thread.sleep(100); + } assertTrue("Expected job store data files at least 1", verifyFilesOnDisk(jobDir) >= 1); - assertEquals("Expected kahadb data files", 1, verifyFilesOnDisk(kahaDir)); + while (verifyFilesOnDisk(kahaDir) < 1) { + Thread.sleep(100); + } + assertTrue("Expected kahadb data files at least 1", verifyFilesOnDisk(kahaDir) >= 1); } @Test diff --git a/activemq-stomp/src/test/java/org/apache/activemq/transport/stomp/StompTestSupport.java b/activemq-stomp/src/test/java/org/apache/activemq/transport/stomp/StompTestSupport.java index b783a54c9b..eddd22aca1 100644 --- a/activemq-stomp/src/test/java/org/apache/activemq/transport/stomp/StompTestSupport.java +++ b/activemq-stomp/src/test/java/org/apache/activemq/transport/stomp/StompTestSupport.java @@ -119,6 +119,9 @@ public class StompTestSupport { } public void startBroker() throws Exception { + if (brokerService != null) { + stopBroker(); + } createBroker(true); XStreamBrokerContext context = new XStreamBrokerContext(); diff --git a/activemq-unit-tests/src/test/java/org/apache/activemq/bugs/AMQ7118Test.java b/activemq-unit-tests/src/test/java/org/apache/activemq/bugs/AMQ7118Test.java index 774422f6b3..18053e48ed 100644 --- a/activemq-unit-tests/src/test/java/org/apache/activemq/bugs/AMQ7118Test.java +++ b/activemq-unit-tests/src/test/java/org/apache/activemq/bugs/AMQ7118Test.java @@ -185,12 +185,18 @@ public class AMQ7118Test { if(doCheckpoint) { LOG.info("Initiating checkpointUpdate "+ ++checkpointIndex + " ..."); broker.getPersistenceAdapter().checkpoint(true); - TimeUnit.SECONDS.sleep(2); + TimeUnit.SECONDS.sleep(4); LOG.info("Checkpoint complete."); } File files[] = dbfiles.listFiles(lff); Arrays.sort(files, new DBFileComparator() ); logfiles(files); + + while (files.length != expectedCount) { + // gives time to checkpoint + TimeUnit.SECONDS.sleep(1); + } + assertEquals(expectedCount, files.length); assertEquals(lastFileName, files[files.length-1].getName());