From 0eab55fa49863935bbc81242b7e13fa550fedc6d Mon Sep 17 00:00:00 2001
From: gbellato <gbellato@localhost>
Date: Tue, 25 Sep 2007 07:29:24 +0000
Subject: [PATCH] some replication hardening :  - fix some race conditions in namingConflict test  - add some cleanup at the end of ReplicationServerDynamicConfTest and    IsolationTest  - don't use anymore 2 statics in the replication code that could cause    problem when in-core restart are done.  - improve the shutdown by making sure that all threads are done    before returning

---
 opends/tests/unit-tests-testng/src/server/org/opends/server/replication/UpdateOperationTest.java |   15 +++++++++++++--
 1 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/opends/tests/unit-tests-testng/src/server/org/opends/server/replication/UpdateOperationTest.java b/opends/tests/unit-tests-testng/src/server/org/opends/server/replication/UpdateOperationTest.java
index d0d0d18..355913f 100644
--- a/opends/tests/unit-tests-testng/src/server/org/opends/server/replication/UpdateOperationTest.java
+++ b/opends/tests/unit-tests-testng/src/server/org/opends/server/replication/UpdateOperationTest.java
@@ -793,6 +793,7 @@
           gen.newChangeNumber(), user1entrysecondUUID);
     broker.publish(delMsg);
     resultEntry = getEntry(personWithUUIDEntry.getDN(), 10000, false);
+    resultEntry = getEntry(personWithSecondUniqueID.getDN(), 10000, false);
 
     // check that the delete operation has been applied
     assertNull(resultEntry,
@@ -1171,9 +1172,19 @@
     broker.publish(modDnMsg);
     // unfortunately it is difficult to check that the operation
     // did not do anything.
-    // The only thing we can check is that resolved naminf conflict counter
+    // The only thing we can check is that resolved naming conflict counter
     // has correctly been incremented.
-    assertEquals(getMonitorDelta(), 1);
+    int count = 0;
+    while ((count<2000) && getMonitorDelta() == 0)
+    {
+      // it is possible that the update has not yet been applied
+      // wait a short time and try again.
+      Thread.sleep(100);
+      count++;
+    }
+    // if the monitor counter did not get incremented after 200sec
+    // then something got wrong.
+    assertTrue(count < 200);
     
     // Check that there was no administrative alert generated
     // because the conflict has been automatically resolved.

--
Gitblit v1.10.0