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 | ||||
| 	}() | ||||
| 
 | ||||
| 	count := 0 | ||||
| 	for { | ||||
| 		top := make(chan string) | ||||
| 		var out string | ||||
|  | @ -551,7 +552,7 @@ func (s *DockerSuite) TestExecWindowsOpenHandles(c *check.C) { | |||
| 
 | ||||
| 		select { | ||||
| 		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: | ||||
| 			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 | ||||
| 			break | ||||
| 		} | ||||
| 		count++ | ||||
| 		if count >= 30 { | ||||
| 			c.Fatal("too many retries") | ||||
| 		} | ||||
| 		time.Sleep(1 * time.Second) | ||||
| 	} | ||||
| 
 | ||||
|  | @ -571,7 +576,7 @@ func (s *DockerSuite) TestExecWindowsOpenHandles(c *check.C) { | |||
| 
 | ||||
| 	select { | ||||
| 	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: | ||||
| 		break | ||||
| 	} | ||||
|  | @ -583,7 +588,7 @@ func (s *DockerSuite) TestExecWindowsOpenHandles(c *check.C) { | |||
| 	// The exec should exit when the background sleep exits | ||||
| 	select { | ||||
| 	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: | ||||
| 		// Ensure the background sleep has actually exited | ||||
| 		out, _ := dockerCmd(c, "top", "test") | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 John Howard
						John Howard