Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid deleting all processes if argument is nil #98

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lib/ruote/storage/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,7 @@ def clear
# the process.
#
def remove_process(wfid)
return if wfid.nil?

2.times do
# two passes
Expand Down
8 changes: 8 additions & 0 deletions test/functional/storage.rb
Original file line number Diff line number Diff line change
Expand Up @@ -580,6 +580,14 @@ def test_remove_process
assert_equal 1, @s.get_many('errors').size
assert_equal 1, @s.get_trackers['trackers'].size

@s.remove_process(nil)

assert_equal 6, @s.get_many('expressions').size
assert_equal 1, @s.get_many('schedules').size
assert_equal 1, @s.get_many('workitems').size
assert_equal 1, @s.get_many('errors').size
assert_equal 1, @s.get_trackers['trackers'].size

ensure
dboard.shutdown rescue nil
end
Expand Down