diff --git a/tests/go.mod b/tests/go.mod index 5616ebb3..3d3901d9 100644 --- a/tests/go.mod +++ b/tests/go.mod @@ -7,7 +7,7 @@ require ( github.com/jinzhu/now v1.1.5 github.com/lib/pq v1.10.9 github.com/stretchr/testify v1.9.0 - gorm.io/driver/mysql v1.5.5 + gorm.io/driver/mysql v1.5.6 gorm.io/driver/postgres v1.5.7 gorm.io/driver/sqlite v1.5.5 gorm.io/driver/sqlserver v1.5.3 diff --git a/tests/prepared_stmt_test.go b/tests/prepared_stmt_test.go index b234c8bf..b86bc3d6 100644 --- a/tests/prepared_stmt_test.go +++ b/tests/prepared_stmt_test.go @@ -126,33 +126,6 @@ func TestPreparedStmtDeadlock(t *testing.T) { AssertEqual(t, sqlDB.Stats().InUse, 0) } -func TestPreparedStmtError(t *testing.T) { - tx, err := OpenTestConnection(&gorm.Config{}) - AssertEqual(t, err, nil) - - sqlDB, _ := tx.DB() - sqlDB.SetMaxOpenConns(1) - - tx = tx.Session(&gorm.Session{PrepareStmt: true}) - - wg := sync.WaitGroup{} - for i := 0; i < 10; i++ { - wg.Add(1) - go func() { - // err prepare - tag := Tag{Locale: "zh"} - tx.Table("users").Find(&tag) - wg.Done() - }() - } - wg.Wait() - - conn, ok := tx.ConnPool.(*gorm.PreparedStmtDB) - AssertEqual(t, ok, true) - AssertEqual(t, len(conn.Stmts), 0) - AssertEqual(t, sqlDB.Stats().InUse, 0) -} - func TestPreparedStmtInTransaction(t *testing.T) { user := User{Name: "jinzhu"}