Skip to content

Commit d22a87e

Browse files
committed
sctest: unskip multitenant for schema change tests
This fixes external process tenant startup to propagate version settings from the parent, allowing tenants to start when the cluster is running at an older version (e.g., MinSupported). Note that MultiRegionTestClusterFactory already allowed multitenant testing. Release note: None
1 parent f84948a commit d22a87e

File tree

3 files changed

+13
-1
lines changed

3 files changed

+13
-1
lines changed

pkg/server/testserver.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -637,6 +637,14 @@ func (ts *testServer) startDefaultTestTenant(
637637
) (serverutils.ApplicationLayerInterface, error) {
638638
tenantSettings := cluster.MakeTestingClusterSettings()
639639
if st := ts.params.Settings; st != nil {
640+
// Use the same version constraints as the parent settings so that
641+
// external process tenants can start when the cluster is running at
642+
// a version older than Latest.
643+
tenantSettings = cluster.MakeTestingClusterSettingsWithVersions(
644+
st.Version.LatestVersion(),
645+
st.Version.MinSupportedVersion(),
646+
false, /* initializeVersion */
647+
)
640648
// Copy overrides and other test-specific configuration,
641649
// as a convenience for test writers that do the following:
642650
// - create a new Settings

pkg/sql/schemachanger/sctest/backup.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -355,6 +355,11 @@ func backupSuccess(t *testing.T, args backupSuccessTestArgs, cs CumulativeTestCa
355355
}
356356

357357
// Upgrade the cluster if applicable.
358+
if args.server.Server.StartedDefaultTestTenant() {
359+
sysDB := args.server.Server.SystemLayer().SQLConn(t)
360+
_, err := sysDB.Exec("SET CLUSTER SETTING VERSION = $1", clusterversion.Latest.String())
361+
require.NoError(t, err)
362+
}
358363
tdb.Exec(t, "SET CLUSTER SETTING VERSION = $1", clusterversion.Latest.String())
359364

360365
// Restore the backup of the database taken mid-successful-schema-change

pkg/sql/schemachanger/sctest/test_server_factory.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,6 @@ func (f SingleNodeTestClusterFactory) Start(ctx context.Context, t *testing.T) T
117117
UseTransactionalDescIDGenerator: true,
118118
},
119119
},
120-
DefaultTestTenant: base.TestDoesNotWorkWithSecondaryTenantsButWeDontKnowWhyYet(142814),
121120
}
122121
if f.server != nil {
123122
args.Knobs.Server = f.server

0 commit comments

Comments
 (0)