Hello John,
welcome to the ruote mailing list.
How about using Ruby's timeout?
http://www.ruby-doc.org/stdlib-1.9.3/libdoc/timeout/rdoc/Timeout.html
Is that sufficient?
--
John Mettraux - http://lambda.io/processi
maybe that :or_error could help:
https://github.com/jmettraux/ruote/commit/5e1084b71195b8c7e16d88c9a67854098dd7c063
You can wait for a participant to receive a workitem or for an error to
happen:
dashboard.wait_for(:alpha, :or_error)
I hope it helps, best regards,
Hello John,
I interpret your
> our test suite is calling dashboard.wait_for(expected_workitem)
as
> our test suite is calling
> dashboard.wait_for(:name_of_the_participant_expected_receive_a_workitem)
In this case, you could write something like
---8<---
r = dashboard.wait_for('dispatched')
assert_equal 'expected_participant_name', r['participant_name']
--->8---
The wait_for will return as soon as a workitem is dispatched. The resulting
message, stored in "r", yields useful info for assertions.
just a quick note, I added a :timeout option to Ruote::Dashboard#wait_for
https://github.com/jmettraux/ruote/commit/4d1b46ef39dec237a08ed9b680f8bc184e673997
and also set a default timeout of 1 minute (I'll see how it goes with the
various storages).
Hope it helps,