From 125747e967e82788df8799622f28a7bcd97a03ad Mon Sep 17 00:00:00 2001 From: Brian Goff Date: Fri, 10 Apr 2015 23:37:46 -0400 Subject: [PATCH] Remove TestRunAutoremove This test is already being skipped, and is also fully tested by `TestRunContainerWithRmFlagExitCodeNotEqualToZero` Signed-off-by: Brian Goff --- integration/commands_test.go | 41 ------------------------------------ 1 file changed, 41 deletions(-) diff --git a/integration/commands_test.go b/integration/commands_test.go index 02efdbe9a7..20b88611c4 100644 --- a/integration/commands_test.go +++ b/integration/commands_test.go @@ -4,12 +4,10 @@ import ( "bufio" "fmt" "io" - "io/ioutil" "strings" "testing" "time" - "github.com/docker/docker/api/client" "github.com/docker/docker/daemon" "github.com/docker/docker/pkg/term" ) @@ -109,42 +107,3 @@ func assertPipe(input, output string, r io.Reader, w io.Writer, count int) error } return nil } - -// Expected behaviour: container gets deleted automatically after exit -func TestRunAutoRemove(t *testing.T) { - t.Skip("Fixme. Skipping test for now, race condition") - stdout, stdoutPipe := io.Pipe() - - cli := client.NewDockerCli(nil, stdoutPipe, ioutil.Discard, "", testDaemonProto, testDaemonAddr, nil) - defer cleanup(globalEngine, t) - - c := make(chan struct{}) - go func() { - defer close(c) - if err := cli.CmdRun("--rm", unitTestImageID, "hostname"); err != nil { - t.Fatal(err) - } - }() - - var temporaryContainerID string - setTimeout(t, "Reading command output time out", 2*time.Second, func() { - cmdOutput, err := bufio.NewReader(stdout).ReadString('\n') - if err != nil { - t.Fatal(err) - } - temporaryContainerID = cmdOutput - if err := closeWrap(stdout, stdoutPipe); err != nil { - t.Fatal(err) - } - }) - - setTimeout(t, "CmdRun timed out", 10*time.Second, func() { - <-c - }) - - time.Sleep(500 * time.Millisecond) - - if len(globalDaemon.List()) > 0 { - t.Fatalf("failed to remove container automatically: container %s still exists", temporaryContainerID) - } -}