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.IncludeCategory(DBTests.class)
@Categories.ExcludeCategory(NonBuildTests.class) @Categories.ExcludeCategory(NonBuildTests.class)
@Suite.SuiteClasses({ @Suite.SuiteClasses({
// From AllUnitTestsSuite // From AllUnitTestsSuite
org.alfresco.repo.dictionary.RepoDictionaryDAOTest.class, org.alfresco.repo.dictionary.RepoDictionaryDAOTest.class,
// From AppContext03TestSuite // From AppContext03TestSuite
org.alfresco.repo.lock.JobLockServiceTest.class, org.alfresco.repo.lock.JobLockServiceTest.class,
org.alfresco.repo.node.db.DbNodeServiceImplTest.class,
org.alfresco.repo.node.db.DbNodeServiceImplPropagationTest.class, org.alfresco.repo.node.db.DbNodeServiceImplPropagationTest.class,
// // From AppContext04TestSuite // // From AppContext04TestSuite
@@ -77,6 +75,10 @@ import org.junit.runners.Suite;
// From MiscContextTestSuite // From MiscContextTestSuite
org.alfresco.repo.domain.query.CannedQueryDAOTest.class, 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 public class AllDBTestsTestSuite
{ {

View File

@@ -116,14 +116,6 @@ public class DbNodeServiceImplPropagationTest extends BaseSpringTest
super.onTearDownInTransaction(); 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 * Loads the test model required for building the node graphs
*/ */
@@ -155,12 +147,6 @@ public class DbNodeServiceImplPropagationTest extends BaseSpringTest
@SuppressWarnings("deprecation") @SuppressWarnings("deprecation")
public void testAuditablePropagation() throws Exception public void testAuditablePropagation() throws Exception
{ {
// See REPO-2963
if (skipTestRepo2963())
{
return;
}
String fullyAuthenticatedUser = AuthenticationUtil.getFullyAuthenticatedUser(); String fullyAuthenticatedUser = AuthenticationUtil.getFullyAuthenticatedUser();
final QName TYPE_NOT_AUDITABLE = ContentModel.TYPE_CONTAINER; final QName TYPE_NOT_AUDITABLE = ContentModel.TYPE_CONTAINER;
@@ -358,6 +344,7 @@ public class DbNodeServiceImplPropagationTest extends BaseSpringTest
endTransaction(); endTransaction();
startNewTransaction(); startNewTransaction();
txn.commit();
} }

View File

@@ -100,14 +100,6 @@ public class DbNodeServiceImplTest extends BaseNodeServiceTest
dictionaryService = (DictionaryService) applicationContext.getBean("dictionaryService"); 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 * Ensure that transactionless calls are handled
*/ */
@@ -122,14 +114,10 @@ public class DbNodeServiceImplTest extends BaseNodeServiceTest
/** /**
* Manually trigger the cleanup registry * Manually trigger the cleanup registry
*/ */
@SuppressWarnings("deprecation")
public void testNodeCleanupRegistry() throws Exception public void testNodeCleanupRegistry() throws Exception
{ {
// See REPO-2963 // REPO-2963: this test takes a long time in order to pass on a clean DB.
if (skipTestRepo2963())
{
return;
}
setComplete(); setComplete();
endTransaction(); endTransaction();
NodeCleanupRegistry cleanupRegistry = (NodeCleanupRegistry) applicationContext.getBean("nodeCleanupRegistry"); NodeCleanupRegistry cleanupRegistry = (NodeCleanupRegistry) applicationContext.getBean("nodeCleanupRegistry");
@@ -141,16 +129,6 @@ public class DbNodeServiceImplTest extends BaseNodeServiceTest
*/ */
public synchronized void testTxnCommitTime() throws Exception 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(); String currentTxn = AlfrescoTransactionSupport.getTransactionId();
assertNotNull("Must have a txn change UUID for all transactions."); assertNotNull("Must have a txn change UUID for all transactions.");