Test: Add buffer to two channels to avoid blocking goroutine
Signed-off-by: Ziheng Liu <lzhfromustc@gmail.com>
This commit is contained in:
parent
e9b4655bc9
commit
d1c2f953c5
2 changed files with 2 additions and 2 deletions
|
@ -45,7 +45,7 @@ var errCancelled = errors.New("build cancelled")
|
|||
// Run a container by ID
|
||||
func (c *containerManager) Run(ctx context.Context, cID string, stdout, stderr io.Writer) (err error) {
|
||||
attached := make(chan struct{})
|
||||
errCh := make(chan error)
|
||||
errCh := make(chan error, 1)
|
||||
go func() {
|
||||
errCh <- c.backend.ContainerAttachRaw(cID, nil, stdout, stderr, true, attached)
|
||||
}()
|
||||
|
|
|
@ -73,7 +73,7 @@ func TestReadPluginNoRead(t *testing.T) {
|
|||
|
||||
buf := bytes.NewBuffer(nil)
|
||||
|
||||
errCh := make(chan error)
|
||||
errCh := make(chan error, 1)
|
||||
go func() {
|
||||
_, err := stdcopy.StdCopy(buf, buf, logs)
|
||||
errCh <- err
|
||||
|
|
Loading…
Add table
Reference in a new issue