Merge component 'engine' from git@github.com:moby/moby master

This commit is contained in:
GordonTheTurtle
2018-05-29 17:06:58 +00:00
3 changed files with 8 additions and 7 deletions

View File

@ -25,10 +25,6 @@ func (s *DockerSuite) TestExecInteractiveStdinClose(c *check.C) {
c.Assert(err, checker.IsNil)
b := bytes.NewBuffer(nil)
go func() {
io.Copy(b, p)
p.Close()
}()
ch := make(chan error)
go func() { ch <- cmd.Wait() }()
@ -36,9 +32,14 @@ func (s *DockerSuite) TestExecInteractiveStdinClose(c *check.C) {
select {
case err := <-ch:
c.Assert(err, checker.IsNil)
output := b.String()
io.Copy(b, p)
p.Close()
bs := b.Bytes()
bs = bytes.Trim(bs, "\x00")
output := string(bs[:])
c.Assert(strings.TrimSpace(output), checker.Equals, "hello")
case <-time.After(5 * time.Second):
p.Close()
c.Fatal("timed out running docker exec")
}
}

View File

@ -34,7 +34,7 @@ func TestInspectNetwork(t *testing.T) {
overlayID := netResp.ID
var instances uint64 = 4
serviceName := "TestService"
serviceName := "TestService" + t.Name()
serviceID := swarm.CreateService(t, d,
swarm.ServiceWithReplicas(instances),

View File

@ -207,7 +207,7 @@ func TestServiceWithPredefinedNetwork(t *testing.T) {
hostName := "host"
var instances uint64 = 1
serviceName := "TestService"
serviceName := "TestService" + t.Name()
serviceID := swarm.CreateService(t, d,
swarm.ServiceWithReplicas(instances),