Skip to content

Commit

Permalink
adding unit test - reduce timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
k-anshul committed Jan 9, 2024
1 parent e3fc93e commit 0c6d535
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions duckdb_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1104,12 +1104,12 @@ func TestQueryTimeout(t *testing.T) {
db := openDB(t)
defer db.Close()

ctx, cancel := context.WithTimeout(context.Background(), time.Second)
ctx, cancel := context.WithTimeout(context.Background(), time.Millisecond*250)
defer cancel()

now := time.Now()
_, err := db.ExecContext(ctx, "CREATE TABLE test AS SELECT * FROM range(10000000) t1, range(1000000) t2;")
require.True(t, errors.Is(err, context.DeadlineExceeded))
require.ErrorIs(t, err, context.DeadlineExceeded)

// a very defensive time check, but should be good enough
// the query takes much longer than 10 seconds
Expand Down

0 comments on commit 0c6d535

Please sign in to comment.