"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "components/engine/integration/container/health_test.go" between
docker-ce-19.03.2.tar.gz and docker-ce-19.03.3.tar.gz

About: Docker CE is a project to pack, ship and run any application as a lightweight container. Docker containers can run anywhere, on a laptop or at scale, in production, on VMs, bare metal, OpenStack clusters, public clouds and more. Community edition.

health_test.go  (docker-ce-19.03.2):health_test.go  (docker-ce-19.03.3)
skipping to change at line 25 skipping to change at line 25
) )
// TestHealthCheckWorkdir verifies that health-checks inherit the containers' // TestHealthCheckWorkdir verifies that health-checks inherit the containers'
// working-dir. // working-dir.
func TestHealthCheckWorkdir(t *testing.T) { func TestHealthCheckWorkdir(t *testing.T) {
skip.If(t, testEnv.OSType == "windows", "FIXME") skip.If(t, testEnv.OSType == "windows", "FIXME")
defer setupTest(t)() defer setupTest(t)()
ctx := context.Background() ctx := context.Background()
client := testEnv.APIClient() client := testEnv.APIClient()
cID := container.Run(t, ctx, client, container.WithTty(true), container.W ithWorkingDir("/foo"), func(c *container.TestContainerConfig) { cID := container.Run(ctx, t, client, container.WithTty(true), container.W ithWorkingDir("/foo"), func(c *container.TestContainerConfig) {
c.Config.Healthcheck = &containertypes.HealthConfig{ c.Config.Healthcheck = &containertypes.HealthConfig{
Test: []string{"CMD-SHELL", "if [ \"$PWD\" = \"/foo\" ]; then exit 0; else exit 1; fi;"}, Test: []string{"CMD-SHELL", "if [ \"$PWD\" = \"/foo\" ]; then exit 0; else exit 1; fi;"},
Interval: 50 * time.Millisecond, Interval: 50 * time.Millisecond,
Retries: 3, Retries: 3,
} }
}) })
poll.WaitOn(t, pollForHealthStatus(ctx, client, cID, types.Healthy), poll .WithDelay(100*time.Millisecond)) poll.WaitOn(t, pollForHealthStatus(ctx, client, cID, types.Healthy), poll .WithDelay(100*time.Millisecond))
} }
// GitHub #37263 // GitHub #37263
// Do not stop healthchecks just because we sent a signal to the container // Do not stop healthchecks just because we sent a signal to the container
func TestHealthKillContainer(t *testing.T) { func TestHealthKillContainer(t *testing.T) {
skip.If(t, testEnv.OSType == "windows", "Windows only supports SIGKILL an d SIGTERM? See https://github.com/moby/moby/issues/39574") skip.If(t, testEnv.OSType == "windows", "Windows only supports SIGKILL an d SIGTERM? See https://github.com/moby/moby/issues/39574")
defer setupTest(t)() defer setupTest(t)()
ctx := context.Background() ctx := context.Background()
client := testEnv.APIClient() client := testEnv.APIClient()
id := container.Run(t, ctx, client, func(c *container.TestContainerConfig ) { id := container.Run(ctx, t, client, func(c *container.TestContainerConfig ) {
c.Config.Healthcheck = &containertypes.HealthConfig{ c.Config.Healthcheck = &containertypes.HealthConfig{
Test: []string{"CMD-SHELL", "sleep 1"}, Test: []string{"CMD-SHELL", "sleep 1"},
Interval: time.Second, Interval: time.Second,
Retries: 5, Retries: 5,
} }
}) })
ctxPoll, cancel := context.WithTimeout(ctx, 30*time.Second) ctxPoll, cancel := context.WithTimeout(ctx, 30*time.Second)
defer cancel() defer cancel()
poll.WaitOn(t, pollForHealthStatus(ctxPoll, client, id, "healthy"), poll. WithDelay(100*time.Millisecond)) poll.WaitOn(t, pollForHealthStatus(ctxPoll, client, id, "healthy"), poll. WithDelay(100*time.Millisecond))
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)