Index: /main/waeup.stress/trunk/src/waeup/stress/__init__.py
===================================================================
--- /main/waeup.stress/trunk/src/waeup/stress/__init__.py	(revision 8654)
+++ /main/waeup.stress/trunk/src/waeup/stress/__init__.py	(revision 8655)
@@ -1,5 +1,7 @@
 import os
+import socket
 import subprocess
 import sys
+import time
 import waeup.kofa
 
@@ -77,4 +79,17 @@
     return
 
+def wait_for_startup(host, port):
+    """Wait until a connection to host and port can be made.
+    """
+    s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
+    while True:
+        try:
+            s.connect((host, port))
+            break
+        except:
+            time.sleep(0.1)
+    s.close()
+    return
+
 def stop_instance(name):
     path = kofa_projects[name]
