Return a 502 when container is down
If the app container is down or not responding then traefik will return a 404 response code. This is not ideal as it suggests a client rather than a server problem. To fix this, we'll define a catch all route that always returns a 502. This is not ideal as this route would take priority over a shorter route with priorty 1. TODO: up the priority of the app route.
This commit is contained in:
@@ -10,8 +10,7 @@ class AppTest < IntegrationTest
|
||||
|
||||
kamal :app, :stop
|
||||
|
||||
# traefik is up and returns 404s when it can't match a route
|
||||
assert_app_not_found
|
||||
assert_app_is_down
|
||||
|
||||
kamal :app, :start
|
||||
|
||||
@@ -51,7 +50,6 @@ class AppTest < IntegrationTest
|
||||
|
||||
kamal :app, :remove
|
||||
|
||||
# traefik is up and returns 404s when it can't match a route
|
||||
assert_app_not_found
|
||||
assert_app_is_down
|
||||
end
|
||||
end
|
||||
|
||||
@@ -55,12 +55,6 @@ class IntegrationTest < ActiveSupport::TestCase
|
||||
assert_app_version(version, response) if version
|
||||
end
|
||||
|
||||
def assert_app_not_found
|
||||
response = app_response
|
||||
debug_response_code(response, "404")
|
||||
assert_equal "404", response.code
|
||||
end
|
||||
|
||||
def wait_for_app_to_be_up(timeout: 20, up_count: 3)
|
||||
timeout_at = Time.now + timeout
|
||||
up_times = 0
|
||||
|
||||
Reference in New Issue
Block a user