From fd9e2810691c152ad7bf9611211b79d67a341d75 Mon Sep 17 00:00:00 2001 From: "adrian.f.cole" Date: Wed, 22 Jul 2009 11:47:42 +0000 Subject: [PATCH] Issue 77: workaround to Web Hosting #119335 git-svn-id: http://jclouds.googlecode.com/svn/trunk@1831 3d8758e0-26b5-11de-8745-db77d3ebf521 --- .../rackspace/cloudservers/domain/ServerStatus.java | 8 ++++++++ .../cloudservers/CloudServersConnectionLiveTest.java | 10 ++++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/rackspace/cloudservers/core/src/main/java/org/jclouds/rackspace/cloudservers/domain/ServerStatus.java b/rackspace/cloudservers/core/src/main/java/org/jclouds/rackspace/cloudservers/domain/ServerStatus.java index 8599f77680..6a2f7dac92 100644 --- a/rackspace/cloudservers/core/src/main/java/org/jclouds/rackspace/cloudservers/domain/ServerStatus.java +++ b/rackspace/cloudservers/core/src/main/java/org/jclouds/rackspace/cloudservers/domain/ServerStatus.java @@ -27,6 +27,14 @@ package org.jclouds.rackspace.cloudservers.domain; * * Servers contain a status attribute that can be used as an indication of the current server state. * Servers with an ACTIVE status are available for use. + *

+ *

Note

+ * When the system changes a server's status from BUILD to ACTIVE the system will not be immediately + * available. The 'ACTIVE' label is really misleading in the fact that it just means the system + * doesn't have any activity going on related to it's configuration. + *

+ * Processes such as ssh will not be available until 5-10 seconds following the phase ACTIVE + *

* * @author Adrian Cole */ diff --git a/rackspace/cloudservers/core/src/test/java/org/jclouds/rackspace/cloudservers/CloudServersConnectionLiveTest.java b/rackspace/cloudservers/core/src/test/java/org/jclouds/rackspace/cloudservers/CloudServersConnectionLiveTest.java index 7e38d54a3d..6712e4e3df 100755 --- a/rackspace/cloudservers/core/src/test/java/org/jclouds/rackspace/cloudservers/CloudServersConnectionLiveTest.java +++ b/rackspace/cloudservers/core/src/test/java/org/jclouds/rackspace/cloudservers/CloudServersConnectionLiveTest.java @@ -307,11 +307,17 @@ public class CloudServersConnectionLiveTest { } private void blockUntilActive(int serverId) throws InterruptedException { - for (Server currentDetails = connection.getServer(serverId); currentDetails.getStatus() != ServerStatus.ACTIVE; currentDetails = connection + Server currentDetails = null; + for (currentDetails = connection.getServer(serverId); currentDetails.getStatus() != ServerStatus.ACTIVE; currentDetails = connection .getServer(serverId)) { System.out.printf("blocking on status active%n%s%n", currentDetails); Thread.sleep(5 * 1000); } + /** + * [Web Hosting #119335] + */ + System.out.printf("awaiting daemons to start %n%s%n", currentDetails); + Thread.sleep(10 * 1000); } @Test(timeOut = 5 * 60 * 1000, dependsOnMethods = "testCreateServer") @@ -348,7 +354,7 @@ public class CloudServersConnectionLiveTest { doCheckPass(newDetails, pass); } catch (SshException e) {// try twice in case there is a network timeout try { - Thread.sleep(2 * 1000); + Thread.sleep(10 * 1000); } catch (InterruptedException e1) { } doCheckPass(newDetails, pass);