Merge pull request #196 from handy-la/main
Configurable max_attempts for healthcheck
This commit is contained in:
@@ -23,8 +23,8 @@ class CliHealthcheckTest < CliTestCase
|
||||
.returns("200")
|
||||
|
||||
run_command("perform").tap do |output|
|
||||
assert_match "Health check against /up failed to respond, retrying in 1s...", output
|
||||
assert_match "Health check against /up failed to respond, retrying in 2s...", output
|
||||
assert_match "Health check against /up failed to respond, retrying in 1s (attempt 1/7)...", output
|
||||
assert_match "Health check against /up failed to respond, retrying in 2s (attempt 2/7)...", output
|
||||
assert_match "Health check against /up succeeded with 200 OK!", output
|
||||
end
|
||||
end
|
||||
|
||||
@@ -249,6 +249,6 @@ class ConfigurationTest < ActiveSupport::TestCase
|
||||
end
|
||||
|
||||
test "to_h" do
|
||||
assert_equal({ :roles=>["web"], :hosts=>["1.1.1.1", "1.1.1.2"], :primary_host=>"1.1.1.1", :version=>"missing", :repository=>"dhh/app", :absolute_image=>"dhh/app:missing", :service_with_version=>"app-missing", :env_args=>["-e", "REDIS_URL=\"redis://x/y\""], :ssh_options=>{:user=>"root", :auth_methods=>["publickey"]}, :volume_args=>["--volume", "/local/path:/container/path"], :logging=>["--log-opt", "max-size=\"10m\""], :healthcheck=>{"path"=>"/up", "port"=>3000 }}, @config.to_h)
|
||||
assert_equal({ :roles=>["web"], :hosts=>["1.1.1.1", "1.1.1.2"], :primary_host=>"1.1.1.1", :version=>"missing", :repository=>"dhh/app", :absolute_image=>"dhh/app:missing", :service_with_version=>"app-missing", :env_args=>["-e", "REDIS_URL=\"redis://x/y\""], :ssh_options=>{:user=>"root", :auth_methods=>["publickey"]}, :volume_args=>["--volume", "/local/path:/container/path"], :logging=>["--log-opt", "max-size=\"10m\""], :healthcheck=>{"path"=>"/up", "port"=>3000, "max_attempts" => 7 }}, @config.to_h)
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user