From 39bce4b6eea869c5c26f172f7b262da2837fb499 Mon Sep 17 00:00:00 2001 From: Nikhil Benesch Date: Sun, 18 Feb 2018 15:55:08 +0000 Subject: [PATCH] partitionccl: deflake TestInitialRepartitioning `DROP DATABASE data` occasionally hangs forever. Release note: None --- pkg/ccl/partitionccl/partition_test.go | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/pkg/ccl/partitionccl/partition_test.go b/pkg/ccl/partitionccl/partition_test.go index 338e4e9678c5..d23712eb8ee0 100644 --- a/pkg/ccl/partitionccl/partition_test.go +++ b/pkg/ccl/partitionccl/partition_test.go @@ -1223,7 +1223,6 @@ func TestSelectPartitionExprs(t *testing.T) { func TestRepartitioning(t *testing.T) { defer leaktest.AfterTest(t)() - t.Skip("#22360") rng, _ := randutil.NewPseudoRand() testCases, err := allRepartitioningTests(allPartitioningTests(rng)) @@ -1235,11 +1234,14 @@ func TestRepartitioning(t *testing.T) { sqlDB, cleanup := setupPartitioningTestCluster(ctx, t) defer cleanup() - for _, test := range testCases { + for i, test := range testCases { t.Run(fmt.Sprintf("%s/%s", test.old.name, test.new.name), func(t *testing.T) { - sqlDB.Exec(t, `DROP DATABASE IF EXISTS data`) - sqlDB.Exec(t, `CREATE DATABASE data`) - sqlDB.Exec(t, `USE data`) + // NOTE: We used to drop and recreate a database named + // "data" at the start of every test, but DROP DATABASE + // would occasionally hang forever. + dbName := fmt.Sprintf("data%d", i) + sqlDB.Exec(t, `CREATE DATABASE `+dbName) + sqlDB.Exec(t, `USE `+dbName) { if err := test.old.parse(); err != nil {