Skip to content

Commit

Permalink
Merge #102013
Browse files Browse the repository at this point in the history
102013: sql: fix race timeouts in TestCopyLarge r=cucaroach a=cucaroach

This test was only inserted 10k rows but under certains metamorphic
combinations this could be really slow.   Lower to 100 and skip under
race.

Epic: none
Release note: none
Fixes: #102010


Co-authored-by: Tommy Reilly <[email protected]>
  • Loading branch information
craig[bot] and cucaroach committed May 3, 2023
2 parents f3ec037 + 9d561e9 commit 9e0b06b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions pkg/sql/copy/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ go_test(
"//pkg/testutils",
"//pkg/testutils/datapathutils",
"//pkg/testutils/serverutils",
"//pkg/testutils/skip",
"//pkg/testutils/sqlutils",
"//pkg/testutils/testcluster",
"//pkg/util/ctxgroup",
Expand Down
5 changes: 4 additions & 1 deletion pkg/sql/copy/copy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ import (
"github.com/cockroachdb/cockroach/pkg/testutils"
"github.com/cockroachdb/cockroach/pkg/testutils/datapathutils"
"github.com/cockroachdb/cockroach/pkg/testutils/serverutils"
"github.com/cockroachdb/cockroach/pkg/testutils/skip"
"github.com/cockroachdb/cockroach/pkg/testutils/sqlutils"
"github.com/cockroachdb/cockroach/pkg/util/ctxgroup"
"github.com/cockroachdb/cockroach/pkg/util/encoding"
Expand Down Expand Up @@ -653,6 +654,8 @@ const lineitemSchemaMunged string = `CREATE TABLE lineitem (
func TestLargeCopy(t *testing.T) {
defer leaktest.AfterTest(t)()
defer log.Scope(t).Close(t)
// This test can cause timeouts.
skip.UnderRace(t)
ctx := context.Background()

s, _, kvdb := serverutils.StartServer(t, base.TestServerArgs{})
Expand All @@ -673,7 +676,7 @@ func TestLargeCopy(t *testing.T) {
require.NoError(t, err)

rng := rand.New(rand.NewSource(0))
rows := 10000
rows := 100
numrows, err := conn.GetDriverConn().CopyFrom(ctx,
&copyReader{rng: rng, cols: desc.PublicColumns(), rows: rows},
"COPY lineitem FROM STDIN WITH CSV;")
Expand Down

0 comments on commit 9e0b06b

Please sign in to comment.