File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed
Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -318,6 +318,23 @@ module FutureExecutionTest
318318 _ ( plan3 . errors . first . message ) . must_match ( /prerequisite execution plans failed/ )
319319 _ ( plan3 . errors . first . message ) . must_match ( /#{ plan2 . id } / )
320320 end
321+
322+ it 'chains runs the chained plan if the prerequisite was halted' do
323+ plan1 = world . plan ( Support ::DummyExample ::Dummy )
324+ plan2 = world . chain ( plan1 . id , Support ::DummyExample ::Dummy )
325+
326+ world . halt ( plan1 . id )
327+ Concurrent ::Promises . resolvable_future . tap do |promise |
328+ world . execute ( plan1 . id , promise )
329+ end . wait
330+
331+ plan1 = world . persistence . load_execution_plan ( plan1 . id )
332+ _ ( plan1 . state ) . must_equal :stopped
333+ _ ( plan1 . result ) . must_equal :pending
334+ ready = world . persistence . find_ready_delayed_plans ( Time . now ) . reject { |p | @preexisting . include? p . execution_plan_uuid }
335+ _ ( ready . count ) . must_equal 1
336+ _ ( ready . first . execution_plan_uuid ) . must_equal plan2 . execution_plan_id
337+ end
321338 end
322339 end
323340 end
You can’t perform that action at this time.
0 commit comments