Read about our upcoming Code of Conduct on this issue

Commit e8660a59 authored by Toon Claes's avatar Toon Claes
Browse files

Merge branch '1305-unable-to-restart-postgresql-in-gitpod' into 'main'

Give services longer to stop before starting again

Closes #1305

See merge request gitlab-org/gitlab-development-kit!2213
......@@ -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