diff --git a/src/python/oftest/controller.py b/src/python/oftest/controller.py
index d262f9f..88f2c65 100644
--- a/src/python/oftest/controller.py
+++ b/src/python/oftest/controller.py
@@ -382,18 +382,14 @@
         self.logger.info("Exiting controller thread")
         self.shutdown()
 
-    def connect(self, timeout=None):
+    def connect(self, timeout=-1):
         """
         Connect to the switch
 
-        @param timeout If None, block until connected.  If 0, return 
-        immedidately.  Otherwise, block for up to timeout seconds
+        @param timeout Block for up to timeout seconds. Pass -1 for the default.
         @return Boolean, True if connected
         """
 
-        if timeout == 0:
-            return self.switch_socket is not None
-
         with self.connect_cv:
             timed_wait(self.connect_cv, lambda: self.switch_socket, timeout=timeout)
         return self.switch_socket is not None
@@ -475,11 +471,7 @@
         If an error occurs, (None, None) is returned
         """
 
-        # TODO make this configurable
-        if timeout == -1:
-            timeout = 1
-
-        self.logger.debug("Poll for %s, timeout %fs" % (ofp_type_map[exp_msg], timeout))
+        self.logger.debug("Poll for %s" % ofp_type_map[exp_msg])
 
         # Take the packet from the queue
         def grab():
@@ -501,7 +493,7 @@
             return None
 
         with self.packets_cv:
-            ret = timed_wait(self.packets_cv, grab)
+            ret = timed_wait(self.packets_cv, grab, timeout=timeout)
 
         if ret != None:
             (msg, pkt) = ret
@@ -529,10 +521,6 @@
         if not zero_xid and msg.header.xid == 0:
             msg.header.xid = gen_xid()
 
-        if timeout == -1:
-            timeout = self.transact_to
-        if timeout == None:
-            timeout = 60
         self.logger.debug("Running transaction %d" % msg.header.xid)
 
         with self.xid_cv:
@@ -547,7 +535,7 @@
                                   msg.header.xid)
                 return (None, None)
 
-            self.logger.debug("Waiting %fs for transaction %d" % (timeout, msg.header.xid))
+            self.logger.debug("Waiting for transaction %d" % msg.header.xid)
             timed_wait(self.xid_cv, lambda: self.xid_response, timeout=timeout)
 
             if self.xid_response:
diff --git a/src/python/oftest/dataplane.py b/src/python/oftest/dataplane.py
index 6b69589..aa434a7 100644
--- a/src/python/oftest/dataplane.py
+++ b/src/python/oftest/dataplane.py
@@ -334,7 +334,7 @@
             pkt, time = port.packets.pop(0)
             yield (port, pkt, time)
 
-    def poll(self, port_number=None, timeout=None, exp_pkt=None):
+    def poll(self, port_number=None, timeout=-1, exp_pkt=None):
         """
         Poll one or all dataplane ports for a packet
 
diff --git a/src/python/oftest/ofutils.py b/src/python/oftest/ofutils.py
index 9e59c5d..3fd9df9 100644
--- a/src/python/oftest/ofutils.py
+++ b/src/python/oftest/ofutils.py
@@ -12,18 +12,23 @@
 """
 Wait on a condition variable until the given function returns non-None or a timeout expires.
 The condition variable must already be acquired.
+The timeout value -1 means use the default timeout.
 There is deliberately no support for an infinite timeout.
 TODO: get the default timeout from configuration
 """
-def timed_wait(cv, fn, timeout=10):
+def timed_wait(cv, fn, timeout=-1):
+    if timeout == -1:
+        # TODO make this configurable
+        timeout = 5
+
     end_time = time.time() + timeout
     while True:
-        if time.time() > end_time:
-            return None
-
         val = fn()
         if val != None:
             return val
 
         remaining_time = end_time - time.time()
         cv.wait(remaining_time)
+
+        if time.time() > end_time:
+            return None
