Skip to content

Commit

Permalink
Merge #49969
Browse files Browse the repository at this point in the history
49969: backupccl: reduce test data size for race tests r=dt a=pbardea

`make testrace` for this test on a GCE worker went from 100 to 20
seconds.

Release note: None

Co-authored-by: Paul Bardea <[email protected]>
  • Loading branch information
craig[bot] and pbardea committed Jun 15, 2020
2 parents c1d0b4a + 215c47b commit 1335676
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions pkg/ccl/backupccl/full_cluster_backup_restore_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import (

_ "github.com/cockroachdb/cockroach/pkg/ccl/partitionccl"
"github.com/cockroachdb/cockroach/pkg/sql/sqlbase"
"github.com/cockroachdb/cockroach/pkg/util"
"github.com/cockroachdb/cockroach/pkg/util/leaktest"
)

Expand All @@ -42,7 +43,11 @@ func TestFullClusterBackup(t *testing.T) {

// Setup the system systemTablesToVerify to ensure that they are copied to the new cluster.
// Populate system.users.
for i := 0; i < 1000; i++ {
numUsers := 1000
if util.RaceEnabled {
numUsers = 10
}
for i := 0; i < numUsers; i++ {
sqlDB.Exec(t, fmt.Sprintf("CREATE USER maxroach%d", i))
}
// Populate system.zones.
Expand Down Expand Up @@ -74,7 +79,11 @@ func TestFullClusterBackup(t *testing.T) {

// Create a bunch of user tables on the restoring cluster that we're going
// to delete.
for i := 0; i < 50; i++ {
numTables := 50
if util.RaceEnabled {
numTables = 2
}
for i := 0; i < numTables; i++ {
sqlDBRestore.Exec(t, `CREATE DATABASE db_to_drop`)
sqlDBRestore.Exec(t, `CREATE TABLE db_to_drop.table_to_drop (a int)`)
sqlDBRestore.Exec(t, `ALTER TABLE db_to_drop.table_to_drop CONFIGURE ZONE USING gc.ttlseconds=1`)
Expand Down

0 comments on commit 1335676

Please sign in to comment.