Skip to content

Commit 4c5e39e

Browse files
committed
Add halting test
1 parent 7a6b52d commit 4c5e39e

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

test/future_execution_test.rb

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)