Merged HEAD (5.1) to 5.1.N (5.1.1)

114820 dhulley: ACE-4479: RenditionServiceIntegrationTest failing on MariaDB
    - Add 60 iterations of 1s waits while checking for appearance of correct data
    - Will succeed faster (when working) while allowing 60s when things are running a little slower


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/DEV/5.1.N/root@114858 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Raluca Munteanu
2015-10-21 09:03:34 +00:00
parent 5ea0ea018f
commit 717b90a2d2

View File

@@ -34,6 +34,7 @@ import java.util.concurrent.TimeUnit;
import javax.imageio.ImageIO;
import org.alfresco.error.AlfrescoRuntimeException;
import org.alfresco.model.ContentModel;
import org.alfresco.model.RenditionModel;
import org.alfresco.repo.action.RuntimeActionService;
@@ -419,12 +420,8 @@ public class RenditionServiceIntegrationTest extends BaseAlfrescoSpringTest
return null;
}
});
// Sleep to let the asynchronous action queue perform the updates to the renditions.
// TODO Is there a better way?
Thread.sleep(30000);
// Get the renditions and check their content for the new title
transactionHelper.doInTransaction(new RetryingTransactionHelper.RetryingTransactionCallback<Void>()
RetryingTransactionCallback<Void> checkRenditionCallback = new RetryingTransactionCallback<Void>()
{
public Void execute() throws Throwable
{
@@ -440,7 +437,29 @@ public class RenditionServiceIntegrationTest extends BaseAlfrescoSpringTest
return null;
}
});
};
// Sleep to let the asynchronous action queue perform the updates to the renditions.
int count = 0;
while (count < 60)
{
count++;
Thread.sleep(1000L);
// Get the renditions and check their content for the new title
try
{
transactionHelper.doInTransaction(checkRenditionCallback);
// Success
break;
}
catch (Exception e)
{
// Failure
if (count > 60)
{
throw e;
}
}
}
}
private void assertRenditionContainsTitle(final String titleValue, String output)