From 1cc1cb099ed8fb0e4fc47debe38a33d17e211a65 Mon Sep 17 00:00:00 2001 From: Solomon Hykes Date: Tue, 2 Apr 2013 11:06:42 -0700 Subject: [PATCH] When simulating disconnects in the tests, make sure that the command returns - but don't check for a specific return value --- commands_test.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/commands_test.go b/commands_test.go index ebbe88c637..27b6605abb 100644 --- a/commands_test.go +++ b/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) }()