Browse Source

Remove TestRunAutoremove

This test is already being skipped, and is also fully tested by
`TestRunContainerWithRmFlagExitCodeNotEqualToZero`

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Brian Goff 10 năm trước cách đây
mục cha
commit
125747e967
1 tập tin đã thay đổi với 0 bổ sung41 xóa
  1. 0 41
      integration/commands_test.go

+ 0 - 41
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)
-	}
-}