Skip to content

Commit 6f3652a

Browse files
committed
serverutils: remove ad-hoc code from StartNewTestCluster
This function is a convenience alias for NewTestCluster+Start. This should not contain custom logic specific to certain tests. Any custom logic should be conditional on testing knobs and put inside `(*testcluster.TestCluster).Start()` instead. (The code removed here was mistakenly added in the wrong place in 70f85cd). Release note: None
1 parent 1925449 commit 6f3652a

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

pkg/sql/logictest/logic.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1494,6 +1494,7 @@ func (t *logicTest) newCluster(
14941494
stats.DefaultRefreshInterval = time.Millisecond
14951495

14961496
t.cluster = serverutils.StartNewTestCluster(t.rootT, cfg.NumNodes, params)
1497+
t.purgeZoneConfig()
14971498
if cfg.UseFakeSpanResolver {
14981499
// We need to update the DistSQL span resolver with the fake resolver.
14991500
// Note that DistSQL was disabled in makeClusterSetting above, so we

pkg/testutils/serverutils/test_cluster_shim.go

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -284,13 +284,9 @@ func StartNewTestCluster(
284284
) TestClusterInterface {
285285
cluster := NewTestCluster(t, numNodes, args)
286286
cluster.Start(t)
287-
for i := 0; i < cluster.NumServers(); i++ {
288-
sysconfigProvider := cluster.Server(i).SystemConfigProvider()
289-
sysconfig := sysconfigProvider.GetSystemConfig()
290-
if sysconfig != nil {
291-
sysconfig.PurgeZoneConfigCache()
292-
}
293-
}
287+
// Note: do not add logic here. To customize cluster configuration,
288+
// add testing knobs and check them in testcluster.NewTestCluster.
289+
// Not all tests use StartNewTestCluster.
294290
return cluster
295291
}
296292

0 commit comments

Comments
 (0)