Skip to content

Commit

Permalink
db/mssql: increase context timeout in test
Browse files Browse the repository at this point in the history
  • Loading branch information
fairclothjm committed Jul 2, 2024
1 parent 66ca2ec commit 2d3ff76
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion plugins/database/mssql/mssql.go
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ func (m *MSSQL) revokeUserDefault(ctx context.Context, username string) error {

rows, err := stmt.QueryContext(ctx, username)
if err != nil {
return err
return fmt.Errorf("failed to query users: %w", err)
}
defer rows.Close()

Expand Down
4 changes: 2 additions & 2 deletions plugins/database/mssql/mssql_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ func TestUpdateUser_password(t *testing.T) {
Username: dbUser,
}

ctx, cancel = context.WithTimeout(context.Background(), 5*time.Second)
ctx, cancel := context.WithTimeout(context.Background(), 20*time.Second)

Check failure on line 297 in plugins/database/mssql/mssql_test.go

View workflow job for this annotation

GitHub Actions / Run Go tests / test-go (13)

no new variables on left side of :=

Check failure on line 297 in plugins/database/mssql/mssql_test.go

View workflow job for this annotation

GitHub Actions / Run Go tests / test-go (13)

no new variables on left side of :=

Check failure on line 297 in plugins/database/mssql/mssql_test.go

View workflow job for this annotation

GitHub Actions / Run Go tests with data race detection / test-go (14)

no new variables on left side of :=

Check failure on line 297 in plugins/database/mssql/mssql_test.go

View workflow job for this annotation

GitHub Actions / Run Go tests with data race detection / test-go (14)

no new variables on left side of :=
defer cancel()
deleteResp, err := db.DeleteUser(ctx, deleteReq)
if err != nil {
Expand Down Expand Up @@ -342,7 +342,7 @@ func TestDeleteUser(t *testing.T) {
Username: dbUser,
}

ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
ctx, cancel := context.WithTimeout(context.Background(), 20*time.Second)
defer cancel()
deleteResp, err := db.DeleteUser(ctx, deleteReq)
if err != nil {
Expand Down

0 comments on commit 2d3ff76

Please sign in to comment.