Skip to content

Commit

Permalink
fix: return bad error after parallel running
Browse files Browse the repository at this point in the history
  • Loading branch information
Vladimir Stepanov committed Jul 9, 2022
1 parent 3c8722d commit 0c1f6b2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion parallel.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ func ParallelContainers(ctx context.Context, reqs ParallelContainerRequest, opt

<-waitRes

if len(errors) == 0 {
if len(errors) != 0 {
return containers, ParallelContainersError{Errors: errors}
}

Expand Down
3 changes: 3 additions & 0 deletions parallel_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ package testcontainers
import (
"context"
"testing"

"github.com/stretchr/testify/require"
)

func TestParallelContainers(t *testing.T) {
Expand Down Expand Up @@ -100,6 +102,7 @@ func TestParallelContainers(t *testing.T) {
res, err := ParallelContainers(context.Background(), tc.reqs, ParallelContainersOptions{})

if err != nil {
require.NotZero(t, tc.expErrors)
e, _ := err.(ParallelContainersError)

if len(e.Errors) != tc.expErrors {
Expand Down

0 comments on commit 0c1f6b2

Please sign in to comment.