mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
When simulating disconnects in the tests, make sure that the command returns - but don't check for a specific return value
This commit is contained in:
parent
aea2675f7b
commit
1cc1cb099e
1 changed files with 6 additions and 6 deletions
|
@ -71,9 +71,9 @@ func TestRunDisconnect(t *testing.T) {
|
||||||
stdout, stdoutPipe := io.Pipe()
|
stdout, stdoutPipe := io.Pipe()
|
||||||
c1 := make(chan struct{})
|
c1 := make(chan struct{})
|
||||||
go func() {
|
go func() {
|
||||||
if err := srv.CmdRun(stdin, stdoutPipe, "-i", GetTestImage(runtime).Id, "/bin/cat"); err != nil {
|
// We're simulating a disconnect so the return value doesn't matter. What matters is the
|
||||||
t.Fatal(err)
|
// fact that CmdRun returns.
|
||||||
}
|
srv.CmdRun(stdin, stdoutPipe, "-i", GetTestImage(runtime).Id, "/bin/cat")
|
||||||
close(c1)
|
close(c1)
|
||||||
}()
|
}()
|
||||||
|
|
||||||
|
@ -135,9 +135,9 @@ func TestAttachDisconnect(t *testing.T) {
|
||||||
// Attach to it
|
// Attach to it
|
||||||
c1 := make(chan struct{})
|
c1 := make(chan struct{})
|
||||||
go func() {
|
go func() {
|
||||||
if err := srv.CmdAttach(stdin, stdoutPipe, container.Id); err != nil {
|
// We're simulating a disconnect so the return value doesn't matter. What matters is the
|
||||||
t.Fatal(err)
|
// fact that CmdAttach returns.
|
||||||
}
|
srv.CmdAttach(stdin, stdoutPipe, container.Id)
|
||||||
close(c1)
|
close(c1)
|
||||||
}()
|
}()
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue