Skip to content

Commit

Permalink
Adapt new tests to upstream changes
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel Joos <danieljoos@github.com>
  • Loading branch information
danieljoos committed Feb 21, 2024
1 parent 2d70a7f commit db9c819
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
4 changes: 0 additions & 4 deletions go/mysql/fakesqldb/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -425,11 +425,7 @@ func (db *DB) HandleQuery(c *mysql.Conn, query string, callback func(*sqltypes.R
userCallback, ok := db.queryPatternUserCallback[pat.expr]
db.mu.Unlock()
if ok {
// Since the user call back can be indefinitely stuck, we shouldn't hold the lock indefinitely.
// This is only test code, so no actual cause for concern.
db.mu.Unlock()
userCallback(query)
db.mu.Lock()
}
if pat.err != "" {
return fmt.Errorf(pat.err)
Expand Down
15 changes: 9 additions & 6 deletions go/vt/vttablet/tabletserver/connpool/dbconn_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -303,9 +303,10 @@ func TestDBKillWithContext(t *testing.T) {
db := fakesqldb.New(t)
defer db.Close()
connPool := newPool()
connPool.Open(db.ConnParams(), db.ConnParams(), db.ConnParams())
params := dbconfigs.New(db.ConnParams())
connPool.Open(params, params, params)
defer connPool.Close()
dbConn, err := newPooledConn(context.Background(), connPool, db.ConnParams())
dbConn, err := newPooledConn(context.Background(), connPool, params)
if dbConn != nil {
defer dbConn.Close()
}
Expand All @@ -330,9 +331,10 @@ func TestDBKillWithContextDoneContext(t *testing.T) {
db := fakesqldb.New(t)
defer db.Close()
connPool := newPool()
connPool.Open(db.ConnParams(), db.ConnParams(), db.ConnParams())
params := dbconfigs.New(db.ConnParams())
connPool.Open(params, params, params)
defer connPool.Close()
dbConn, err := newPooledConn(context.Background(), connPool, db.ConnParams())
dbConn, err := newPooledConn(context.Background(), connPool, params)
if dbConn != nil {
defer dbConn.Close()
}
Expand Down Expand Up @@ -589,9 +591,10 @@ func TestDBExecOnceKillTimeout(t *testing.T) {
db := fakesqldb.New(t)
defer db.Close()
connPool := newPool()
connPool.Open(db.ConnParams(), db.ConnParams(), db.ConnParams())
params := dbconfigs.New(db.ConnParams())
connPool.Open(params, params, params)
defer connPool.Close()
dbConn, err := newPooledConn(context.Background(), connPool, db.ConnParams())
dbConn, err := newPooledConn(context.Background(), connPool, params)
if dbConn != nil {
defer dbConn.Close()
}
Expand Down

0 comments on commit db9c819

Please sign in to comment.