From 06757db3aca209339126dd2fc0f5ecb859e649d1 Mon Sep 17 00:00:00 2001
From: Ludovic Poitou <ludovic.poitou@forgerock.com>
Date: Mon, 12 Sep 2011 20:52:58 +0000
Subject: [PATCH] Fix to OPENDJ-274, resolve remaining nightly unit test failure with modifications of single valued attributes. Tidy up some of the unit-tests around that area, adding more controls, making sure tests stop services on failure and reducing time to run.

---
 opends/tests/unit-tests-testng/src/server/org/opends/server/replication/plugin/HistoricalTest.java |   39 ++++++++-------------------------------
 1 files changed, 8 insertions(+), 31 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 ac7f899..8da0637 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
@@ -23,6 +23,7 @@
  *
  *
  *      Copyright 2008-2010 Sun Microsystems, Inc.
+ *      Portions Copyright 2011 ForgeRock AS
  */
 
 package org.opends.server.replication.plugin;
@@ -346,8 +347,6 @@
     mod = new Modification(ModificationType.ADD, attr);
     publishModify(broker, t2, dn1, entryuuid, mod);
 
-    Thread.sleep(2000);
-
     // Simulate the reverse ordering t2:add:B followed by t1:add:A that
     // would happen on the other server.
 
@@ -529,16 +528,16 @@
 
       assertEquals(count, assertCount);
     }
-  
+
   /**
-   * Test the task that purges the replication historical stored in the user 
+   * Test the task that purges the replication historical stored in the user
    * entry.
    * Steps :
    * - creates entry containing historical
    * - wait for the pruge delay
    * - lauch the purge task
    * - 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 purge. And verify that the second run starts on the changeNumber where
@@ -554,36 +553,14 @@
 
     addEntriesWithHistorical(1, entryCnt);
 
-    /*
-    // every entry should have its hist
-    try
-    {
-      // Search for matching entries in config backend
-      InternalSearchOperation op = connection.processSearch(
-          ByteString.valueOf(TEST_ROOT_DN_STRING),
-          SearchScope.WHOLE_SUBTREE,
-          LDAPFilter.decode("(ds-sync-hist=*)"));
-      assertEquals(op.getResultCode(), ResultCode.SUCCESS,
-          op.getErrorMessage().toString());
-
-      // Check that no entries have been found
-      LinkedList<SearchResultEntry> entries = op.getSearchEntries();
-      assertTrue(entries != null);
-      assertEquals(entries.size(), entryCnt);
-    } catch (Exception e)
-    {
-      fail("assertNoConfigEntriesWithFilter: could not search config backend" + e.getMessage());
-    }
-    */
-
     // set the purge delay to 1 sec
     TestCaseUtils.dsconfig(
         "set-replication-domain-prop",
         "--provider-name","Multimaster Synchronization",
         "--domain-name",testName,
-        "--set","conflicts-historical-purge-delay:1m");
+        "--set","conflicts-historical-purge-delay:1s");
 
-    Thread.sleep(60*1000);
+    Thread.sleep(2*1000);
 
     // launch the purge
     Entry taskInit = TestCaseUtils.makeEntry(
@@ -594,7 +571,7 @@
         "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: 1000"); // 1000 sec
+    "ds-task-purge-conflicts-historical-maximum-duration: 120"); // 120 sec
 
     addTask(taskInit, ResultCode.SUCCESS, null);
 
@@ -699,5 +676,5 @@
 
       assertEquals(LDAPModify.mainModify(args, false, null, System.err), 0);
     }
-  }  
+  }
 }

--
Gitblit v1.10.0