From c3193273193ea10f59684b9684c3a2ce08a33307 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Llei=CC=88r=20Borra=CC=80s=20Metje?= Date: Mon, 30 Jan 2017 11:31:54 +0100 Subject: [PATCH] Avoid deleting all processes if argument is nil --- lib/ruote/storage/base.rb | 1 + test/functional/storage.rb | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/lib/ruote/storage/base.rb b/lib/ruote/storage/base.rb index 53e3f8ba..26d73dd0 100644 --- a/lib/ruote/storage/base.rb +++ b/lib/ruote/storage/base.rb @@ -278,6 +278,7 @@ def clear # the process. # def remove_process(wfid) + return if wfid.nil? 2.times do # two passes diff --git a/test/functional/storage.rb b/test/functional/storage.rb index bdc21cd6..c6edfe79 100644 --- a/test/functional/storage.rb +++ b/test/functional/storage.rb @@ -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