Browse Source

When simulating disconnects in the tests, make sure that the command returns - but don't check for a specific return value

Solomon Hykes 12 years ago
parent
commit
1cc1cb099e
1 changed files with 6 additions and 6 deletions
  1. 6 6
      commands_test.go

+ 6 - 6
commands_test.go

@@ -71,9 +71,9 @@ func TestRunDisconnect(t *testing.T) {
 	stdout, stdoutPipe := io.Pipe()
 	c1 := make(chan struct{})
 	go func() {
-		if err := srv.CmdRun(stdin, stdoutPipe, "-i", GetTestImage(runtime).Id, "/bin/cat"); err != nil {
-			t.Fatal(err)
-		}
+		// We're simulating a disconnect so the return value doesn't matter. What matters is the
+		// fact that CmdRun returns.
+		srv.CmdRun(stdin, stdoutPipe, "-i", GetTestImage(runtime).Id, "/bin/cat")
 		close(c1)
 	}()
 
@@ -135,9 +135,9 @@ func TestAttachDisconnect(t *testing.T) {
 	// Attach to it
 	c1 := make(chan struct{})
 	go func() {
-		if err := srv.CmdAttach(stdin, stdoutPipe, container.Id); err != nil {
-			t.Fatal(err)
-		}
+		// We're simulating a disconnect so the return value doesn't matter. What matters is the
+		// fact that CmdAttach returns.
+		srv.CmdAttach(stdin, stdoutPipe, container.Id)
 		close(c1)
 	}()