From 0ff97689e2e9f26169cc8394bd6bcc21b6027400 Mon Sep 17 00:00:00 2001 From: Viktor Date: Thu, 14 Sep 2017 18:21:18 +0100 Subject: [PATCH] Zombie processes integration test --- integration_tests/integration_swarm_test.go | 43 ++++++++++----------- 1 file changed, 21 insertions(+), 22 deletions(-) diff --git a/integration_tests/integration_swarm_test.go b/integration_tests/integration_swarm_test.go index 2e543600..b08f2504 100644 --- a/integration_tests/integration_swarm_test.go +++ b/integration_tests/integration_swarm_test.go @@ -178,28 +178,27 @@ func (s IntegrationSwarmTestSuite) Test_Compression() { } } -// The attempt to remove zombie processes failed -//func (s IntegrationSwarmTestSuite) Test_ZombieProcesses() { -// for i:=0; i < 30; i++ { -// s.reconfigureGoDemo("") -// } -// out, err := exec.Command( -// "/bin/sh", -// "-c", -// "docker container ls -q -f \"label=com.docker.swarm.service.name=proxy\" | tail -n 1", -// ).CombinedOutput() -// s.NoError(err) -// out, err = exec.Command( -// "/bin/sh", -// "-c", -// "docker container exec -t " + strings.Trim(string(out), "\n") + " ps aux | grep haproxy", -// ).CombinedOutput() -// time.Sleep(10 * time.Second) -// -// s.NoError(err) -// // There should be only one processes plus extra line at the end of the output -// s.Len(strings.Split(string(out), "\n"), 2) -//} +func (s IntegrationSwarmTestSuite) Test_ZombieProcesses() { + for i:=0; i < 30; i++ { + s.reconfigureGoDemo("") + } + out, err := exec.Command( + "/bin/sh", + "-c", + "docker container ls -q -f \"label=com.docker.swarm.service.name=proxy\" | tail -n 1", + ).CombinedOutput() + s.NoError(err) + out, err = exec.Command( + "/bin/sh", + "-c", + "docker container exec -t " + strings.Trim(string(out), "\n") + " ps aux | grep haproxy", + ).CombinedOutput() + time.Sleep(10 * time.Second) + + s.NoError(err) + // There should be only one processes plus extra line at the end of the output + s.Len(strings.Split(string(out), "\n"), 2) +} func (s IntegrationSwarmTestSuite) Test_HeaderAcls() { client := new(http.Client)