Permalink
Browse files

Cannot wait for sync in this test as there are extra backups

  • Loading branch information...
1 parent b95b043 commit cb99eeacc9030bc728e9ad3d05c2bac2e56f2593 Francisco Borges committed Nov 19, 2012
@@ -222,20 +222,14 @@ protected void waitForTopology(final HornetQServer server, String clusterConnect
throw new Exception(msg);
}
- protected final static void waitForComponent(final HornetQComponent component, final long seconds) throws Exception
+ protected final static void
+ waitForComponent(final HornetQComponent component, final long seconds) throws InterruptedException
{
long time = System.currentTimeMillis();
long toWait = seconds * 1000;
while (!component.isStarted())
{
- try
- {
- Thread.sleep(50);
- }
- catch (InterruptedException e)
- {
- // ignore
- }
+ Thread.sleep(50);
if (System.currentTimeMillis() > (time + toWait))
{
fail("component did not start within timeout of " + seconds);
@@ -47,18 +47,18 @@ public void testStartLiveFirst() throws Exception
startServers(liveServers);
startServers(backupServers);
- waitForBackupSyncs();
+ waitForBackups();
sendCrashReceive();
waitForTopology(backupServers.get(0).getServer(), liveServers.size(), 2);
sendCrashBackupReceive();
}
- private void waitForBackupSyncs()
+ private void waitForBackups() throws InterruptedException
{
for (TestableServer backupServer : backupServers)
{
- waitForRemoteBackupSynchronization(backupServer.getServer());
+ waitForComponent(backupServer.getServer(), 5);
}
}
@@ -69,6 +69,7 @@ private void startServers(List<TestableServer> servers) throws Exception
testableServer.start();
}
}
+
@Override
public void testStartBackupFirst() throws Exception
{
@@ -77,7 +78,7 @@ public void testStartBackupFirst() throws Exception
startServers(backupServers);
startServers(liveServers);
- waitForBackupSyncs();
+ waitForBackups();
waitForTopology(liveServers.get(0).getServer(), liveServers.size(), 2);
sendCrashReceive();

0 comments on commit cb99eea

Please sign in to comment.