Skip to content

Commit f73ef47

Browse files
committed
changefeedccl: enable a couple of tests with test tenant
Release note: None
1 parent 7487733 commit f73ef47

File tree

4 files changed

+26
-42
lines changed

4 files changed

+26
-42
lines changed

pkg/ccl/changefeedccl/alter_changefeed_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ func TestAlterChangefeedAddTargetPrivileges(t *testing.T) {
5757
ctx := context.Background()
5858

5959
s, db, _ := serverutils.StartServer(t, base.TestServerArgs{
60-
DefaultTestTenant: base.TODOTestTenantDisabled,
60+
DefaultTestTenant: base.TestDoesNotWorkWithSecondaryTenantsButWeDontKnowWhyYet(142799),
6161
Knobs: base.TestingKnobs{
6262
JobsTestingKnobs: jobs.NewTestingKnobsWithShortIntervals(),
6363
DistSQL: &execinfra.TestingKnobs{

pkg/ccl/changefeedccl/changefeed_test.go

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2621,7 +2621,7 @@ func TestChangefeedExternalIODisabled(t *testing.T) {
26212621
}
26222622
ctx := context.Background()
26232623
s, db, _ := serverutils.StartServer(t, base.TestServerArgs{
2624-
DefaultTestTenant: base.TODOTestTenantDisabled,
2624+
DefaultTestTenant: base.TestDoesNotWorkWithSecondaryTenantsButWeDontKnowWhyYet(142799),
26252625
ExternalIODirConfig: base.ExternalIODirConfig{
26262626
DisableOutbound: true,
26272627
},
@@ -4067,7 +4067,7 @@ func TestChangefeedCreateAuthorizationWithChangefeedPriv(t *testing.T) {
40674067

40684068
ctx := context.Background()
40694069
s, db, _ := serverutils.StartServer(t, base.TestServerArgs{
4070-
DefaultTestTenant: base.TODOTestTenantDisabled,
4070+
DefaultTestTenant: base.TestDoesNotWorkWithSecondaryTenantsButWeDontKnowWhyYet(142799),
40714071
Knobs: base.TestingKnobs{
40724072
JobsTestingKnobs: jobs.NewTestingKnobsWithShortIntervals(),
40734073
DistSQL: &execinfra.TestingKnobs{
@@ -8384,9 +8384,7 @@ func TestChangefeedHandlesDrainingNodes(t *testing.T) {
83848384

83858385
tc := serverutils.StartCluster(t, 4, base.TestClusterArgs{
83868386
ServerArgs: base.TestServerArgs{
8387-
// Test uses SPLIT AT, which isn't currently supported for
8388-
// secondary tenants. Tracked with #76378.
8389-
DefaultTestTenant: base.TODOTestTenantDisabled,
8387+
DefaultTestTenant: base.TestDoesNotWorkWithSecondaryTenantsButWeDontKnowWhyYet(142799),
83908388
UseDatabase: "test",
83918389
Knobs: knobs,
83928390
ExternalIODir: sinkDir,
@@ -8549,9 +8547,7 @@ func TestChangefeedHandlesRollingRestart(t *testing.T) {
85498547
return perNode
85508548
}(),
85518549
ServerArgs: base.TestServerArgs{
8552-
// Test uses SPLIT AT, which isn't currently supported for
8553-
// secondary tenants. Tracked with #76378.
8554-
DefaultTestTenant: base.TODOTestTenantDisabled,
8550+
DefaultTestTenant: base.TestDoesNotWorkWithSecondaryTenantsButWeDontKnowWhyYet(142799),
85558551
},
85568552
})
85578553
defer tc.Stopper().Stop(context.Background())
@@ -8707,9 +8703,7 @@ func TestChangefeedTimelyResolvedTimestampUpdatePostRollingRestart(t *testing.T)
87078703
base.TestClusterArgs{
87088704
ServerArgsPerNode: perServerKnobs,
87098705
ServerArgs: base.TestServerArgs{
8710-
// Test uses SPLIT AT, which isn't currently supported for
8711-
// secondary tenants. Tracked with #76378.
8712-
DefaultTestTenant: base.TODOTestTenantDisabled,
8706+
DefaultTestTenant: base.TestDoesNotWorkWithSecondaryTenantsButWeDontKnowWhyYet(142799),
87138707
},
87148708
ReusableListenerReg: listenerReg,
87158709
})
@@ -8802,9 +8796,7 @@ func TestChangefeedPropagatesTerminalError(t *testing.T) {
88028796
ServerArgsPerNode: perServerKnobs,
88038797
ReplicationMode: base.ReplicationManual,
88048798
ServerArgs: base.TestServerArgs{
8805-
// Test uses SPLIT AT, which isn't currently supported for
8806-
// secondary tenants. Tracked with #76378.
8807-
DefaultTestTenant: base.TODOTestTenantDisabled,
8799+
DefaultTestTenant: base.TestDoesNotWorkWithSecondaryTenantsButWeDontKnowWhyYet(142799),
88088800
},
88098801
})
88108802
defer tc.Stopper().Stop(context.Background())
@@ -11309,7 +11301,7 @@ func TestChangefeedExecLocality(t *testing.T) {
1130911301
const nodes = 4
1131011302
args := base.TestClusterArgs{
1131111303
ServerArgs: base.TestServerArgs{
11312-
DefaultTestTenant: base.TODOTestTenantDisabled, // need nodelocal and splits.
11304+
DefaultTestTenant: base.TestDoesNotWorkWithSecondaryTenantsButWeDontKnowWhyYet(142799),
1131311305
},
1131411306
ServerArgsPerNode: map[int]base.TestServerArgs{},
1131511307
}

pkg/ccl/changefeedccl/parquet_test.go

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -48,17 +48,16 @@ func TestParquetRows(t *testing.T) {
4848
skip.UnderStress(t)
4949

5050
ctx := context.Background()
51-
s, db, _ := serverutils.StartServer(t, base.TestServerArgs{
52-
// TODO(#98816): cdctest.GetHydratedTableDescriptor does not work with tenant dbs.
53-
// Once it is fixed, this flag can be removed.
54-
DefaultTestTenant: base.TODOTestTenantDisabled,
55-
})
56-
defer s.Stopper().Stop(ctx)
51+
srv, db, _ := serverutils.StartServer(t, base.TestServerArgs{})
52+
defer srv.Stopper().Stop(ctx)
53+
s := srv.ApplicationLayer()
54+
55+
sysDB := sqlutils.MakeSQLRunner(srv.SystemLayer().SQLConn(t))
56+
sysDB.Exec(t, "SET CLUSTER SETTING kv.rangefeed.enabled = true")
5757

5858
maxRowGroupSize := int64(4)
5959

6060
sqlDB := sqlutils.MakeSQLRunner(db)
61-
sqlDB.Exec(t, "SET CLUSTER SETTING kv.rangefeed.enabled = true")
6261

6362
newDecimal := func(s string) *tree.DDecimal {
6463
d, _, _ := apd.NewFromString(s)
@@ -264,7 +263,7 @@ func TestParquetRows(t *testing.T) {
264263
}
265264

266265
func makeRangefeedReaderAndDecoder(
267-
t *testing.T, s serverutils.TestServerInterface,
266+
t *testing.T, s serverutils.ApplicationLayerInterface,
268267
) (func(t testing.TB) *kvpb.RangeFeedValue, func(), cdcevent.Decoder) {
269268
tableDesc := cdctest.GetHydratedTableDescriptor(t, s.ExecutorConfig(), "foo")
270269
popRow, cleanup := cdctest.MakeRangeFeedValueReader(t, s.ExecutorConfig(), tableDesc)

pkg/ccl/changefeedccl/scheduled_changefeed_test.go

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import (
99
"context"
1010
gosql "database/sql"
1111
"fmt"
12-
"net/url"
1312
"strconv"
1413
"strings"
1514
"testing"
@@ -304,8 +303,7 @@ func TestCreateChangefeedScheduleChecksPermissionsDuringDryRun(t *testing.T) {
304303
defer log.Scope(t).Close(t)
305304

306305
ctx := context.Background()
307-
s, db, _ := serverutils.StartServer(t, base.TestServerArgs{
308-
DefaultTestTenant: base.TODOTestTenantDisabled,
306+
srv, db, _ := serverutils.StartServer(t, base.TestServerArgs{
309307
Knobs: base.TestingKnobs{
310308
JobsTestingKnobs: jobs.NewTestingKnobsWithShortIntervals(),
311309
DistSQL: &execinfra.TestingKnobs{
@@ -320,25 +318,20 @@ func TestCreateChangefeedScheduleChecksPermissionsDuringDryRun(t *testing.T) {
320318
},
321319
},
322320
})
323-
defer s.Stopper().Stop(ctx)
324-
rootDB := sqlutils.MakeSQLRunner(db)
325-
rootDB.Exec(t, `SET CLUSTER SETTING kv.rangefeed.enabled = true`)
321+
defer srv.Stopper().Stop(ctx)
322+
s := srv.ApplicationLayer()
323+
324+
sysDB := sqlutils.MakeSQLRunner(srv.SystemLayer().SQLConn(t))
325+
sysDB.Exec(t, "SET CLUSTER SETTING kv.rangefeed.enabled = true")
326+
327+
sqlDB := sqlutils.MakeSQLRunner(db)
326328
enableEnterprise := utilccl.TestingDisableEnterprise()
327329
enableEnterprise()
328330

329-
rootDB.Exec(t, `CREATE TABLE table_a (i int)`)
330-
rootDB.Exec(t, `CREATE USER testuser WITH PASSWORD 'test'`)
331+
sqlDB.Exec(t, `CREATE TABLE table_a (i int)`)
332+
sqlDB.Exec(t, `CREATE USER testuser WITH PASSWORD 'test'`)
331333

332-
pgURL := url.URL{
333-
Scheme: "postgres",
334-
User: url.UserPassword("testuser", "test"),
335-
Host: s.SQLAddr(),
336-
}
337-
db2, err := gosql.Open("postgres", pgURL.String())
338-
if err != nil {
339-
t.Fatal(err)
340-
}
341-
defer db2.Close()
334+
db2 := s.SQLConn(t, serverutils.UserPassword("testuser", "test"))
342335
userDB := sqlutils.MakeSQLRunner(db2)
343336

344337
userDB.ExpectErr(t, `Failed to dry run create changefeed: user "testuser" requires the CHANGEFEED privilege on all target tables to be able to run an enterprise changefeed`,

0 commit comments

Comments
 (0)