mirror of https://github.com/apache/activemq.git
Merge pull request #581 from jbonofre/FIX_TESTS
Improve tests stability
This commit is contained in:
commit
2d16fdc0f0
|
@ -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());
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -119,6 +119,9 @@ public class StompTestSupport {
|
|||
}
|
||||
|
||||
public void startBroker() throws Exception {
|
||||
if (brokerService != null) {
|
||||
stopBroker();
|
||||
}
|
||||
createBroker(true);
|
||||
|
||||
XStreamBrokerContext context = new XStreamBrokerContext();
|
||||
|
|
|
@ -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());
|
||||
|
||||
|
|
Loading…
Reference in New Issue