mirror of
				https://github.com/moby/moby.git
				synced 2025-11-03 16:33:18 +03:00 
			
		
		
		
	test: add buffer to prevent goroutine leak
Signed-off-by: Ziheng Liu <lzhfromustc@gmail.com>
This commit is contained in:
		@@ -33,7 +33,7 @@ func (s *DockerSuite) TestAttachClosedOnContainerStop(c *testing.T) {
 | 
			
		||||
	err = attachCmd.Start()
 | 
			
		||||
	assert.NilError(c, err)
 | 
			
		||||
 | 
			
		||||
	errChan := make(chan error)
 | 
			
		||||
	errChan := make(chan error, 1)
 | 
			
		||||
	go func() {
 | 
			
		||||
		time.Sleep(300 * time.Millisecond)
 | 
			
		||||
		defer close(errChan)
 | 
			
		||||
@@ -68,7 +68,7 @@ func (s *DockerSuite) TestAttachAfterDetach(c *testing.T) {
 | 
			
		||||
	cmd.Stdout = tty
 | 
			
		||||
	cmd.Stderr = tty
 | 
			
		||||
 | 
			
		||||
	cmdExit := make(chan error)
 | 
			
		||||
	cmdExit := make(chan error, 1)
 | 
			
		||||
	go func() {
 | 
			
		||||
		cmdExit <- cmd.Run()
 | 
			
		||||
		close(cmdExit)
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user