mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Improve TestMultipleAttachRestart to avoid unnecessary warning
This commit is contained in:
parent
a22c78523f
commit
c45beabcd5
1 changed files with 4 additions and 11 deletions
|
@ -116,8 +116,8 @@ func TestMultipleAttachRestart(t *testing.T) {
|
|||
if err := container.Start(); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
timeout := make(chan bool)
|
||||
go func() {
|
||||
|
||||
setTimeout(t, "Timeout reading from the process", 3*time.Second, func() {
|
||||
l1, err = bufio.NewReader(stdout1).ReadString('\n')
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
|
@ -139,15 +139,8 @@ func TestMultipleAttachRestart(t *testing.T) {
|
|||
if strings.Trim(l3, " \r\n") != "hello" {
|
||||
t.Fatalf("Unexpected output. Expected [%s], received [%s]", "hello", l3)
|
||||
}
|
||||
timeout <- false
|
||||
}()
|
||||
go func() {
|
||||
time.Sleep(3 * time.Second)
|
||||
timeout <- true
|
||||
}()
|
||||
if <-timeout {
|
||||
t.Fatalf("Timeout reading from the process")
|
||||
}
|
||||
})
|
||||
container.Wait()
|
||||
}
|
||||
|
||||
func TestDiff(t *testing.T) {
|
||||
|
|
Loading…
Add table
Reference in a new issue