mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Avoid TestExecWindowsOpenHandles timing out
Signed-off-by: John Howard <jhoward@microsoft.com>
This commit is contained in:
parent
c3b660b112
commit
f8821202c6
1 changed files with 8 additions and 3 deletions
|
@ -541,6 +541,7 @@ func (s *DockerSuite) TestExecWindowsOpenHandles(c *check.C) {
|
||||||
exec <- true
|
exec <- true
|
||||||
}()
|
}()
|
||||||
|
|
||||||
|
count := 0
|
||||||
for {
|
for {
|
||||||
top := make(chan string)
|
top := make(chan string)
|
||||||
var out string
|
var out string
|
||||||
|
@ -551,7 +552,7 @@ func (s *DockerSuite) TestExecWindowsOpenHandles(c *check.C) {
|
||||||
|
|
||||||
select {
|
select {
|
||||||
case <-time.After(time.Second * 5):
|
case <-time.After(time.Second * 5):
|
||||||
c.Error("timed out waiting for top while exec is exiting")
|
c.Fatal("timed out waiting for top while exec is exiting")
|
||||||
case out = <-top:
|
case out = <-top:
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
@ -560,6 +561,10 @@ func (s *DockerSuite) TestExecWindowsOpenHandles(c *check.C) {
|
||||||
// The initial exec process (cmd.exe) has exited, and both sleeps are currently running
|
// The initial exec process (cmd.exe) has exited, and both sleeps are currently running
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
count++
|
||||||
|
if count >= 30 {
|
||||||
|
c.Fatal("too many retries")
|
||||||
|
}
|
||||||
time.Sleep(1 * time.Second)
|
time.Sleep(1 * time.Second)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -571,7 +576,7 @@ func (s *DockerSuite) TestExecWindowsOpenHandles(c *check.C) {
|
||||||
|
|
||||||
select {
|
select {
|
||||||
case <-time.After(time.Second * 5):
|
case <-time.After(time.Second * 5):
|
||||||
c.Error("timed out waiting for inspect while exec is exiting")
|
c.Fatal("timed out waiting for inspect while exec is exiting")
|
||||||
case <-inspect:
|
case <-inspect:
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
@ -583,7 +588,7 @@ func (s *DockerSuite) TestExecWindowsOpenHandles(c *check.C) {
|
||||||
// The exec should exit when the background sleep exits
|
// The exec should exit when the background sleep exits
|
||||||
select {
|
select {
|
||||||
case <-time.After(time.Second * 15):
|
case <-time.After(time.Second * 15):
|
||||||
c.Error("timed out waiting for async exec to exit")
|
c.Fatal("timed out waiting for async exec to exit")
|
||||||
case <-exec:
|
case <-exec:
|
||||||
// Ensure the background sleep has actually exited
|
// Ensure the background sleep has actually exited
|
||||||
out, _ := dockerCmd(c, "top", "test")
|
out, _ := dockerCmd(c, "top", "test")
|
||||||
|
|
Loading…
Add table
Reference in a new issue