From ea16c22c6b725367e499b31054497246b67ca703 Mon Sep 17 00:00:00 2001
From: Jean-Noel Rouvignac <jean-noel.rouvignac@forgerock.com>
Date: Fri, 11 Oct 2013 14:29:15 +0000
Subject: [PATCH] Trying to fix random failures for HistoricalTest.testRecurringPurgeIn1Run().
---
opends/tests/unit-tests-testng/src/server/org/opends/server/replication/plugin/HistoricalTest.java | 23 +++++++++++++----------
1 files changed, 13 insertions(+), 10 deletions(-)
diff --git a/opends/tests/unit-tests-testng/src/server/org/opends/server/replication/plugin/HistoricalTest.java b/opends/tests/unit-tests-testng/src/server/org/opends/server/replication/plugin/HistoricalTest.java
index f444c43..ad9b933 100644
--- a/opends/tests/unit-tests-testng/src/server/org/opends/server/replication/plugin/HistoricalTest.java
+++ b/opends/tests/unit-tests-testng/src/server/org/opends/server/replication/plugin/HistoricalTest.java
@@ -479,7 +479,7 @@
* - verify that all historical has been purged
*
* TODO: another test should be written that configures the task no NOT have
- * the time to purge everything in 1 run .. and thus to relauch it to finish
+ * the time to purge everything in 1 run .. and thus to relaunch it to finish
* the purge. And verify that the second run starts on the CSN where
* the previous task run had stopped.
*/
@@ -489,6 +489,9 @@
int entryCnt = 10;
addEntriesWithHistorical(1, entryCnt);
+ // leave a little delay between adding/modifying test entries
+ // and configuring the purge delay.
+ Thread.sleep(10);
// set the purge delay to 1 minute
// FIXME could we change this setting to also accept seconds?
@@ -500,23 +503,23 @@
"--domain-name",testName,
"--set","conflicts-historical-purge-delay:1m");
- Thread.sleep(60*1000);
+ // Let's go past the purge delay
+ Thread.sleep(60 * 1000);
// launch the purge
- Entry taskInit = TestCaseUtils.makeEntry(
- "dn: ds-task-id=" + UUID.randomUUID() +
- ",cn=Scheduled Tasks,cn=Tasks",
+ final int maxWaitTimeInSeconds = 120;
+ Entry purgeConflictsHistoricalTask = TestCaseUtils.makeEntry(
+ "dn: ds-task-id=" + UUID.randomUUID() + ",cn=Scheduled Tasks,cn=Tasks",
"objectclass: top",
"objectclass: ds-task",
"objectclass: ds-task-purge-conflicts-historical",
"ds-task-class-name: org.opends.server.tasks.PurgeConflictsHistoricalTask",
- "ds-task-purge-conflicts-historical-domain-dn: "+TEST_ROOT_DN_STRING,
- "ds-task-purge-conflicts-historical-maximum-duration: 120"); // 120 sec
-
- executeTask(taskInit);
+ "ds-task-purge-conflicts-historical-domain-dn: " + TEST_ROOT_DN_STRING,
+ "ds-task-purge-conflicts-historical-maximum-duration: " + maxWaitTimeInSeconds);
+ executeTask(purgeConflictsHistoricalTask, maxWaitTimeInSeconds * 1000);
// every entry should be purged from its hist
- // Search for matching entries in config backend
+ // Search for matching entries in config backend
InternalSearchOperation op = connection.processSearch(
TEST_ROOT_DN_STRING, SearchScope.WHOLE_SUBTREE, "(ds-sync-hist=*)");
assertEquals(op.getResultCode(), ResultCode.SUCCESS, op.getErrorMessage().toString());
--
Gitblit v1.10.0