REPO-2963 : Tests causing a cascade of failures in AllDBTestsTestSuit… (#81)

* REPO-2963 : Tests causing a cascade of failures in AllDBTestsTestSuite on PostgreSQL/MySQL
   Remove skipTestRepo2963() call from DbNodeServiceImplTest and DbNodeServiceImplPropagationTest
   Add txn.commit() in order to commit the UserTransaction from DbNodeServiceImplPropagationTest.testAuditablePropagation() this leftover made other tests fail.
   Move DbNodeServiceImplTest at the bottom of the AllDBTestTestSuite because of testNodeCleanupRegistry() is taking a long time to pass on a cleanDB.
This commit is contained in:
Alexandru-Eusebiu Epure
2018-02-28 15:49:34 +02:00
committed by GitHub
parent e895764da3
commit dd722b94e7
3 changed files with 10 additions and 43 deletions

View File

@@ -38,13 +38,11 @@ import org.junit.runners.Suite;
@Categories.IncludeCategory(DBTests.class)
@Categories.ExcludeCategory(NonBuildTests.class)
@Suite.SuiteClasses({
// From AllUnitTestsSuite
org.alfresco.repo.dictionary.RepoDictionaryDAOTest.class,
// From AppContext03TestSuite
org.alfresco.repo.lock.JobLockServiceTest.class,
org.alfresco.repo.node.db.DbNodeServiceImplTest.class,
org.alfresco.repo.node.db.DbNodeServiceImplPropagationTest.class,
// // From AppContext04TestSuite
@@ -77,6 +75,10 @@ import org.junit.runners.Suite;
// From MiscContextTestSuite
org.alfresco.repo.domain.query.CannedQueryDAOTest.class,
// REPO-2963 : Tests causing a cascade of failures in AllDBTestsTestSuite on PostgreSQL/MySQL
// Moved at the bottom of the suite because DbNodeServiceImplTest.testNodeCleanupRegistry() takes a long time on a clean DB.
org.alfresco.repo.node.db.DbNodeServiceImplTest.class,
})
public class AllDBTestsTestSuite
{

View File

@@ -115,14 +115,6 @@ public class DbNodeServiceImplPropagationTest extends BaseSpringTest
}
super.onTearDownInTransaction();
}
// REPO-2963 Initially just pass tests on selected DBs
protected boolean skipTestRepo2963()
{
return true; // Always skip the test
// String name = dialect.getClass().getName();
// return name.contains("PostgreSQL") || name.contains("MySQL");
}
/**
* Loads the test model required for building the node graphs
@@ -155,12 +147,6 @@ public class DbNodeServiceImplPropagationTest extends BaseSpringTest
@SuppressWarnings("deprecation")
public void testAuditablePropagation() throws Exception
{
// See REPO-2963
if (skipTestRepo2963())
{
return;
}
String fullyAuthenticatedUser = AuthenticationUtil.getFullyAuthenticatedUser();
final QName TYPE_NOT_AUDITABLE = ContentModel.TYPE_CONTAINER;
@@ -301,7 +287,7 @@ public class DbNodeServiceImplPropagationTest extends BaseSpringTest
assertEquals(fullyAuthenticatedUser, nodeService.getProperty(n2Ref, ContentModel.PROP_MODIFIER));
assertEquals(fullyAuthenticatedUser, nodeService.getProperty(ac1, ContentModel.PROP_MODIFIER));
assertEquals(fullyAuthenticatedUser, nodeService.getProperty(ac2, ContentModel.PROP_MODIFIER));
// Updates won't apply if the parent is newer than the child
Date now = new Date();
long futureShift = 4000l;
@@ -356,8 +342,9 @@ public class DbNodeServiceImplPropagationTest extends BaseSpringTest
setComplete();
endTransaction();
startNewTransaction();
txn.commit();
}

View File

@@ -100,14 +100,6 @@ public class DbNodeServiceImplTest extends BaseNodeServiceTest
dictionaryService = (DictionaryService) applicationContext.getBean("dictionaryService");
}
// REPO-2963 Initially just pass tests on selected DBs
protected boolean skipTestRepo2963()
{
return true; // Always skip the test
// String name = dialect.getClass().getName();
// return name.contains("PostgreSQL") || name.contains("MySQL");
}
/**
* Ensure that transactionless calls are handled
*/
@@ -122,35 +114,21 @@ public class DbNodeServiceImplTest extends BaseNodeServiceTest
/**
* Manually trigger the cleanup registry
*/
@SuppressWarnings("deprecation")
public void testNodeCleanupRegistry() throws Exception
{
// See REPO-2963
if (skipTestRepo2963())
{
return;
}
// REPO-2963: this test takes a long time in order to pass on a clean DB.
setComplete();
endTransaction();
NodeCleanupRegistry cleanupRegistry = (NodeCleanupRegistry) applicationContext.getBean("nodeCleanupRegistry");
cleanupRegistry.doClean();
}
/**
* <a href="https://issues.alfresco.com/jira/browse/ALF-14929">ALF-14929</a>
*/
public synchronized void testTxnCommitTime() throws Exception
{
// See REPO-2963
if (skipTestRepo2963())
{
return;
}
/*
* This test is subject to intermittent - but correct - failures if bug ALF-14929 is present
*/
String currentTxn = AlfrescoTransactionSupport.getTransactionId();
assertNotNull("Must have a txn change UUID for all transactions.");