Index: oak-segment-tar/src/test/java/org/apache/jackrabbit/oak/segment/CompactionAndCleanupIT.java =================================================================== --- oak-segment-tar/src/test/java/org/apache/jackrabbit/oak/segment/CompactionAndCleanupIT.java (revision 1750050) +++ oak-segment-tar/src/test/java/org/apache/jackrabbit/oak/segment/CompactionAndCleanupIT.java (working copy) @@ -206,7 +206,8 @@ fileStore.flush(); long size2 = fileStore.size(); - assertSize("1st blob added", size2, size1 + blobSize, size1 + blobSize + (blobSize / 100)); + assertTrue("adding a blob should increase the size of the store", size2 > size1); + assertTrue("the size of the blob should have increased of at least the size of the blob", size2 - size1 >= blobSize); // Now remove the property. No gc yet -> size doesn't shrink builder = nodeStore.getRoot().builder(); @@ -215,15 +216,15 @@ fileStore.flush(); long size3 = fileStore.size(); - assertSize("1st blob removed", size3, size2, size2 + 4096); + assertTrue("removing a property should increase the size of the store", size3 > size2); // 1st gc cycle -> 1st blob should get collected fileStore.compact(); fileStore.cleanup(); long size4 = fileStore.size(); - assertSize("1st gc", size4, size3 - blobSize - size1, size3 - - blobSize); + assertTrue("GC should have decreased the size of the store", size4 < size3); + assertTrue("GC should at least have removed the blob", size3 - size4 >= blobSize); // Add another 5MB binary builder = nodeStore.getRoot().builder(); @@ -232,22 +233,17 @@ fileStore.flush(); long size5 = fileStore.size(); - assertSize("2nd blob added", size5, size4 + blobSize, size4 + blobSize + (blobSize / 100)); + assertTrue("adding a blob should increase the size of the store", size5 > size4); + assertTrue("the size of the blob should have increased of at least the size of the blob", size5 - size4 >= blobSize); // 2st gc cycle -> 2nd blob should *not* be collected fileStore.compact(); fileStore.cleanup(); - long size6 = fileStore.size(); - assertSize("2nd gc", size6, size5 * 10/11, size5 * 10/9); - // 3rd gc cycle -> no significant change fileStore.compact(); fileStore.cleanup(); - long size7 = fileStore.size(); - assertSize("3rd gc", size7, size6 * 10/11 , size6 * 10/9); - // No data loss byte[] blob = ByteStreams.toByteArray(nodeStore.getRoot() .getProperty("blob2").getValue(Type.BINARY).getNewStream());