Skip to content

Commit

Permalink
made sure errors occurring in participants are replayable
Browse files Browse the repository at this point in the history
  • Loading branch information
jmettraux committed Jul 1, 2009
1 parent ab29d7b commit b50270b
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 0 deletions.
3 changes: 3 additions & 0 deletions TODO.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@

[ ] file logger service
[ ] fs_error_journal
[ ] fs_error_journal : restart test

[o] cache storage
[o] fs storage
Expand Down Expand Up @@ -115,3 +116,5 @@ restart tests :

[o] participant : do thread (and do_not_thread)

[o] add test for error replay in participant

65 changes: 65 additions & 0 deletions test/functional/ft_2_errors.rb
Original file line number Diff line number Diff line change
Expand Up @@ -87,5 +87,70 @@ def test_error_fix_then_replay

assert_equal 'alpha', @tracer.to_s
end

def test_error_in_participant

pdef = Ruote.process_definition do
sequence do
alpha
echo 'done.'
end
end

count = 0

@engine.register_participant :alpha do
count += 1
@tracer << "alpha\n"
raise "something went wrong" if count == 1
end

wfid = @engine.launch(pdef)

wait_for(wfid)

ps = @engine.process_status(wfid)

assert_equal 1, ps.errors.size

@engine.replay_at_error(ps.errors.first)

wait_for(wfid)

assert_equal %w[ alpha alpha done. ].join("\n"), @tracer.to_s
end

def test_error_in_do_no_thread_participant

pdef = Ruote.process_definition do
sequence do
alpha
echo 'done.'
end
end

count = 0

alpha = @engine.register_participant :alpha do
count += 1
@tracer << "alpha\n"
raise "something went wrong" if count == 1
end
alpha.do_not_thread = true

wfid = @engine.launch(pdef)

wait_for(wfid)

ps = @engine.process_status(wfid)

assert_equal 1, ps.errors.size

@engine.replay_at_error(ps.errors.first)

wait_for(wfid)

assert_equal %w[ alpha alpha done. ].join("\n"), @tracer.to_s
end
end

0 comments on commit b50270b

Please sign in to comment.