From 3f3a12a708ce53bc12cca8817ff6812ea86eb585 Mon Sep 17 00:00:00 2001
From: pgamba <pgamba@localhost>
Date: Tue, 22 Dec 2009 11:49:34 +0000
Subject: [PATCH] Still try to improve this test

---
 opends/tests/unit-tests-testng/src/server/org/opends/server/replication/server/ReplicationServerTest.java |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/opends/tests/unit-tests-testng/src/server/org/opends/server/replication/server/ReplicationServerTest.java b/opends/tests/unit-tests-testng/src/server/org/opends/server/replication/server/ReplicationServerTest.java
index d33cfb3..5bfe689 100644
--- a/opends/tests/unit-tests-testng/src/server/org/opends/server/replication/server/ReplicationServerTest.java
+++ b/opends/tests/unit-tests-testng/src/server/org/opends/server/replication/server/ReplicationServerTest.java
@@ -703,7 +703,7 @@
         reader[i].start();
       }
       debugInfo("multipleWriterMultipleReader produces and readers started");
-      Thread.sleep(2000);
+      //Thread.sleep(2000);
     }
     finally
     {
@@ -1168,7 +1168,11 @@
             numMsgRcv++;
             broker.updateWindowAfterReplay();
           }
-          if ((msg == null) || (numMsgRcv >= numMsgExpected))
+          // if ((msg == null) || (numMsgRcv >= numMsgExpected))
+          // Terminating this thread when the nb of msg received is reached
+          // may prevent to process a WindowMsg that would unblock the dual
+          // writer thread.
+          if (msg == null)
             break;
         }
       } catch (SocketTimeoutException e)
@@ -1188,6 +1192,7 @@
             "a BrokerReader received an Exception" + e.getMessage()
             + stackTraceToSingleLineString(e);
       }
+      assert(numMsgRcv >= numMsgExpected);
     }
   }
 

--
Gitblit v1.10.0