Read about our upcoming Code of Conduct on this issue

Commit a4e016e8 authored by Ash McKenzie's avatar Ash McKenzie
Browse files

Give services longer to stop before starting again

parent 5cf77bb6aaf0
......@@ -6,6 +6,8 @@ module GDK
class Restart < BaseCommand
def run(args = [])
GDK::Command::Stop.new.run(args)
# Give services a little longer to shutdown.
sleep(3)
GDK::Command::Start.new.run(args)
end
end
......
......@@ -6,6 +6,7 @@ RSpec.describe GDK::Command::Restart do
context 'with no extra arguments' do
it 'calls stop then start without specifying services' do
expect_any_instance_of(GDK::Command::Stop).to receive(:run).with([])
expect(subject).to receive(:sleep).with(3)
expect_any_instance_of(GDK::Command::Start).to receive(:run).with([])
subject.run
......@@ -17,6 +18,7 @@ RSpec.describe GDK::Command::Restart do
services = %w[rails-web]
expect_any_instance_of(GDK::Command::Stop).to receive(:run).with(services)
expect(subject).to receive(:sleep).with(3)
expect_any_instance_of(GDK::Command::Start).to receive(:run).with(services)
subject.run(services)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment