Merge pull request #581 from jbonofre/FIX_TESTS

Improve tests stability
This commit is contained in:
Jean-Baptiste Onofré 2020-11-18 16:27:09 +01:00 committed by GitHub
commit 2d16fdc0f0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 19 additions and 4 deletions

View File

@ -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());

View File

@ -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

View File

@ -119,6 +119,9 @@ public class StompTestSupport {
}
public void startBroker() throws Exception {
if (brokerService != null) {
stopBroker();
}
createBroker(true);
XStreamBrokerContext context = new XStreamBrokerContext();

View File

@ -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());