Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Browse files

Fix timeout in await state event

When state events that you are not expecting occur, await_state_event
can never time out
  • Loading branch information...
1 parent fc4178e commit 0bcddf3675c4c8c0e4fffa94965c2e31901da1cd @oldpatricka oldpatricka committed
Showing with 5 additions and 0 deletions.
  1. +5 −0 ion/services/cei/test/
5 ion/services/cei/test/
@@ -1,4 +1,5 @@
from gevent import queue
+from datetime import datetime, timedelta
from pyon.event.event import EventSubscriber
from pyon.public import log
@@ -31,10 +32,14 @@ def await_state_event(self, pid=None, state=None, timeout=30, strict=False):
if strict is False, allow intermediary events
+ start_time =
assert state in ProcessStateEnum._str_map, "process state %s unknown!" % state
state_str = ProcessStateEnum._str_map.get(state)
while 1:
+ if - start_time > timedelta(seconds=timeout):
+ raise AssertionError("Waiter timeout! Waited %s seconds for process %s state %s" % (timeout, pid, state_str))
event = self.event_queue.get(timeout=timeout)
except queue.Empty:

0 comments on commit 0bcddf3

Please sign in to comment.
Something went wrong with that request. Please try again.