Merged BRANCHES/DEV/V3.3-BUG-FIX to HEAD:

22883: ALF-4800 - AVM - intermittent test failure (layered file delete)


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@22884 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Jan Vonka
2010-10-05 11:55:50 +00:00
parent 5ef4758194
commit 00ea243bc3
2 changed files with 21 additions and 3 deletions

View File

@@ -2982,6 +2982,14 @@ public class AVMServiceLocalTest extends TestCase
diffs = fSyncService.compare(-1, "mainB--layer:/a", -1, "mainB:/a", null); diffs = fSyncService.compare(-1, "mainB--layer:/a", -1, "mainB:/a", null);
assertEquals("[mainB--layer:/a/foo[-1] > mainB:/a/foo[-1]]", diffs.toString()); assertEquals("[mainB--layer:/a/foo[-1] > mainB:/a/foo[-1]]", diffs.toString());
/*
// For testing ALF-4800 (testLayeredFileDelete1 / testLayeredFileDelete2 - error in dispatchUpdate)
// In addition to sleep below, increase frequency of OrphanReaper (eg. set startDelay/repeatInterval to 2000/500 msecs)
logger.debug("start sleep");
Thread.sleep(30000);
logger.debug("finish sleep");
*/
// ETHREEOH-2844 // ETHREEOH-2844
fSyncService.update(diffs, null, false, false, false, false, "one", "one"); fSyncService.update(diffs, null, false, false, false, false, "one", "one");
fSyncService.flatten("mainB--layer:/a", "mainB:/a"); fSyncService.flatten("mainB--layer:/a", "mainB:/a");
@@ -3105,6 +3113,14 @@ public class AVMServiceLocalTest extends TestCase
diffs = fSyncService.compare(-1, "mainB--layer:/a", -1, "mainB:/a", null); diffs = fSyncService.compare(-1, "mainB--layer:/a", -1, "mainB:/a", null);
assertEquals("[mainB--layer:/a/foo[-1] > mainB:/a/foo[-1]]", diffs.toString()); assertEquals("[mainB--layer:/a/foo[-1] > mainB:/a/foo[-1]]", diffs.toString());
/*
// For testing ALF-4800 (testLayeredFileDelete1 / testLayeredFileDelete2 - error in dispatchUpdate)
// In addition to sleep below, increase frequency of OrphanReaper (eg. set startDelay/repeatInterval to 2000/500 msecs)
logger.debug("start sleep");
Thread.sleep(30000);
logger.debug("finish sleep");
*/
// ETHREEOH-2829 // ETHREEOH-2829
fSyncService.update(diffs, null, false, false, false, false, "one", "one"); fSyncService.update(diffs, null, false, false, false, false, "one", "one");
fSyncService.flatten("mainB--layer:/a", "mainB:/a"); fSyncService.flatten("mainB--layer:/a", "mainB:/a");

View File

@@ -812,7 +812,8 @@ public class AVMSyncServiceImpl implements AVMSyncService
} }
} }
if (srcDesc.isDeleted() && (srcDesc.getDeletedType() == AVMNodeType.LAYERED_DIRECTORY)) if (srcDesc.isDeleted() &&
((srcDesc.getDeletedType() == AVMNodeType.LAYERED_DIRECTORY) || (srcDesc.getDeletedType() == AVMNodeType.LAYERED_FILE)))
{ {
Integer diff = compareLayeredCommonAncestor(common, srcDesc, dstDesc); Integer diff = compareLayeredCommonAncestor(common, srcDesc, dstDesc);
if (diff != null) if (diff != null)
@@ -820,7 +821,8 @@ public class AVMSyncServiceImpl implements AVMSyncService
return diff; return diff;
} }
} }
else if (dstDesc.isDeleted() && (dstDesc.getDeletedType() == AVMNodeType.LAYERED_DIRECTORY)) else if (dstDesc.isDeleted() &&
((dstDesc.getDeletedType() == AVMNodeType.LAYERED_DIRECTORY) || (dstDesc.getDeletedType() == AVMNodeType.LAYERED_FILE)))
{ {
Integer diff = compareLayeredCommonAncestor(common, dstDesc, srcDesc); Integer diff = compareLayeredCommonAncestor(common, dstDesc, srcDesc);
if (diff != null) if (diff != null)
@@ -1054,7 +1056,7 @@ public class AVMSyncServiceImpl implements AVMSyncService
{ {
diff = diffType; diff = diffType;
} }
else if (common.isLayeredFile()) else if (common.isLayeredFile() || (compareAncNode.getType() == AVMNodeType.LAYERED_FILE))
{ {
// TODO review (alongside createSnapshot+COW) // TODO review (alongside createSnapshot+COW)
diff = compareLayeredCommonAncestor(common, compareAncNode.getId(), diffType); diff = compareLayeredCommonAncestor(common, compareAncNode.getId(), diffType);