Skip to content

Commit

Permalink
test: (*Connection).Create in parallel
Browse files Browse the repository at this point in the history
  • Loading branch information
zepatrik committed Jul 12, 2022
1 parent 3f8518a commit 107833e
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions executors_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package pop

import (
"fmt"
"testing"
"time"

Expand Down Expand Up @@ -533,6 +534,19 @@ func Test_Create_Non_PK_ID(t *testing.T) {
})
}

func Test_Create_Parallel(t *testing.T) {
if PDB == nil {
t.Skip("skipping integration tests")
}
for i := 0; i < 50; i++ {
i := i
t.Run(fmt.Sprintf("case=%d", i), func(t *testing.T) {
t.Parallel()
require.NoError(t, PDB.Create(&User{Name: nulls.NewString(fmt.Sprintf("User %d", i))}))
})
}
}

func Test_Embedded_Struct(t *testing.T) {
if PDB == nil {
t.Skip("skipping integration tests")
Expand Down

0 comments on commit 107833e

Please sign in to comment.