mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

gbellato
27.31.2009 6c7fa214b88ce9ad2d0ab03029ee38a8ab0e22f8
Fix some random failure in ReplicationServerTest where the tests are opening 
repetitively broker sessions to the Replication Server which can cause some
normal failure.

The problem that is fixed here was was that the tests didn't attempt to connect again.
3 files modified
10 ■■■■■ changed files
opends/tests/unit-tests-testng/src/server/org/opends/server/replication/ReplicationTestCase.java 3 ●●●●● patch | view | raw | blame | history
opends/tests/unit-tests-testng/src/server/org/opends/server/replication/plugin/StateMachineTest.java 1 ●●●● patch | view | raw | blame | history
opends/tests/unit-tests-testng/src/server/org/opends/server/replication/server/ReplicationServerTest.java 6 ●●●●● patch | view | raw | blame | history
opends/tests/unit-tests-testng/src/server/org/opends/server/replication/ReplicationTestCase.java
@@ -372,6 +372,7 @@
      try
      {
        Thread.sleep(1000);
        rb.start();
      } catch (InterruptedException ex)
      {
        fail("Error sleeping " + stackTraceToSingleLineString(ex));
@@ -416,6 +417,7 @@
    ArrayList<String> servers = new ArrayList<String>(1);
    servers.add("localhost:" + port);
    broker.start(servers);
    checkConnection(30, broker, port);
    if (timeout != 0)
      broker.setSoTimeout(timeout);
@@ -455,6 +457,7 @@
    ArrayList<String> servers = new ArrayList<String>(1);
    servers.add("localhost:" + port);
    broker.start(servers);
    checkConnection(30, broker, port);
    if (timeout != 0)
      broker.setSoTimeout(timeout);
    if (emptyOldChanges)
opends/tests/unit-tests-testng/src/server/org/opends/server/replication/plugin/StateMachineTest.java
@@ -328,6 +328,7 @@
    ArrayList<String> servers = new ArrayList<String>(1);
    servers.add("localhost:" + rs1Port);
    broker.start(servers);
    checkConnection(30, broker, rs1Port);
    return broker;
  }
opends/tests/unit-tests-testng/src/server/org/opends/server/replication/server/ReplicationServerTest.java
@@ -248,10 +248,10 @@
       */
      server1 = openReplicationSession(
          DN.decode(TEST_ROOT_DN_STRING),  1, 100, replicationServerPort,
          1000, true);
          1000, false);
      server2 = openReplicationSession(
          DN.decode(TEST_ROOT_DN_STRING),  2, 100, replicationServerPort,
          1000, true);
          1000, false);
      assertTrue(server1.isConnected());
      assertTrue(server2.isConnected());
@@ -419,8 +419,6 @@
        openReplicationSession(DN.decode(TEST_ROOT_DN_STRING),  3,
                             100, replicationServerPort, 5000, state);
      assertTrue(broker.isConnected(), "Broker could not connect to RS");
      ReplicationMsg msg2 = broker.receive();
      broker.updateWindowAfterReplay();
      if (!(msg2 instanceof DeleteMsg))