summaryrefslogtreecommitdiff
path: root/integration
diff options
context:
space:
mode:
authorCory Snider <csnider@mirantis.com>2022-08-18 17:49:13 -0400
committerSebastiaan van Stijn <github@gone.nl>2022-08-24 13:59:34 +0200
commit0cbb92bcc543767e5abe6f912ea797166fe25cba (patch)
treed4f9900aac4ffe8dcd556b036a15082875993c3a /integration
parentc7d74a2366d5507e628a309a3fff2f1f2984544a (diff)
downloaddocker-0cbb92bcc543767e5abe6f912ea797166fe25cba.tar.gz
daemon: capture output of killed health checks
Add an integration test to verify that health checks are killed on timeout and that the output is captured. Co-authored-by: Nicolas De Loof <nicolas.deloof@gmail.com> Signed-off-by: Cory Snider <csnider@mirantis.com> Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Diffstat (limited to 'integration')
-rw-r--r--integration/container/health_test.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/integration/container/health_test.go b/integration/container/health_test.go
index c55e9e9180..fde0dca407 100644
--- a/integration/container/health_test.go
+++ b/integration/container/health_test.go
@@ -103,13 +103,13 @@ func TestHealthCheckProcessKilled(t *testing.T) {
cID := container.Run(ctx, t, apiClient, func(c *container.TestContainerConfig) {
c.Config.Healthcheck = &containertypes.HealthConfig{
- Test: []string{"CMD", "sh", "-c", "sleep 60"},
+ Test: []string{"CMD", "sh", "-c", `echo "logs logs logs"; sleep 60`},
Interval: 100 * time.Millisecond,
Timeout: 50 * time.Millisecond,
Retries: 1,
}
})
- poll.WaitOn(t, pollForHealthCheckLog(ctx, apiClient, cID, "Health check exceeded timeout (50ms)"))
+ poll.WaitOn(t, pollForHealthCheckLog(ctx, apiClient, cID, "Health check exceeded timeout (50ms): logs logs logs\n"))
}
func pollForHealthCheckLog(ctx context.Context, client client.APIClient, containerID string, expected string) func(log poll.LogT) poll.Result {