Skip to content

Commit

Permalink
chore: fix test failure
Browse files Browse the repository at this point in the history
  • Loading branch information
kevwan committed Apr 17, 2024
1 parent 25f92c4 commit bd8cc06
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions core/stores/sqlx/stmt_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -294,15 +294,15 @@ func TestStmtBreaker(t *testing.T) {
func TestQueryRowsScanTimeout(t *testing.T) {
dbtest.RunTest(t, func(db *sql.DB, mock sqlmock.Sqlmock) {
rows := sqlmock.NewRows([]string{"foo"})
for i := 0; i < 100000; i++ {
for i := 0; i < 10000; i++ {
rows = rows.AddRow("bar" + strconv.Itoa(i))
}
mock.ExpectQuery("any").WillReturnRows(rows)
var val []struct {
Foo string
}
conn := NewSqlConnFromDB(db)
ctx, cancel := context.WithTimeout(context.Background(), time.Millisecond*5)
ctx, cancel := context.WithTimeout(context.Background(), time.Millisecond*2)
err := conn.QueryRowsCtx(ctx, &val, "any")
assert.ErrorIs(t, err, context.DeadlineExceeded)
cancel()
Expand Down

0 comments on commit bd8cc06

Please sign in to comment.