Skip to content

Commit

Permalink
do not merge: force parquet when possible during tests
Browse files Browse the repository at this point in the history
This change will not be merged. When it is possible for tests
to use parquet, this change forces them to use parquet.

This change also forces tests for updated timestamps and mvcc
timestamps to use the cloudstorage sink + parquet format.

Release note: None
Epic: None
  • Loading branch information
jayshrivastava committed Jun 6, 2023
1 parent 350fb1e commit 1332113
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
8 changes: 4 additions & 4 deletions pkg/ccl/changefeedccl/changefeed_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -880,7 +880,7 @@ func TestChangefeedTimestamps(t *testing.T) {
sqlDB.Exec(t, `CREATE TABLE foo (a INT PRIMARY KEY)`)
sqlDB.Exec(t, `INSERT INTO foo VALUES (0)`)

foo := feed(t, f, `CREATE CHANGEFEED FOR foo WITH updated, resolved`)
foo := feed(t, f, `CREATE CHANGEFEED FOR foo WITH updated, resolved, format=parquet`)
defer closeFeed(t, foo)

// Grab the first non resolved-timestamp row.
Expand Down Expand Up @@ -927,7 +927,7 @@ func TestChangefeedTimestamps(t *testing.T) {
}
}

cdcTest(t, testFn)
cdcTest(t, testFn, feedTestForceSink("cloudstorage"))
}

func TestChangefeedMVCCTimestamps(t *testing.T) {
Expand All @@ -950,12 +950,12 @@ func TestChangefeedMVCCTimestamps(t *testing.T) {
id, mvccTimestamp)
}

changeFeed := feed(t, f, `CREATE CHANGEFEED FOR mvcc_timestamp_test_table WITH mvcc_timestamp`)
changeFeed := feed(t, f, `CREATE CHANGEFEED FOR mvcc_timestamp_test_table WITH mvcc_timestamp, format=parquet`)
defer closeFeed(t, changeFeed)
assertPayloads(t, changeFeed, expectedPayloads)
}

cdcTest(t, testFn)
cdcTest(t, testFn, feedTestForceSink("cloudstorage"))
}

func TestChangefeedResolvedFrequency(t *testing.T) {
Expand Down
3 changes: 3 additions & 0 deletions pkg/ccl/changefeedccl/helpers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -852,6 +852,9 @@ func randomSinkTypeWithOptions(options feedTestOptions) string {
for _, sinkType := range options.allowedSinkTypes {
sinkWeights[sinkType] = 1
}
if _, ok := sinkWeights["cloudstorage"]; ok {
sinkWeights = map[string]int{"cloudstorage": 1}
}
}
if options.disabledSinkTypes != nil {
for _, sinkType := range options.disabledSinkTypes {
Expand Down
2 changes: 1 addition & 1 deletion pkg/ccl/changefeedccl/testfeed_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1072,7 +1072,7 @@ func (f *cloudFeedFactory) Feed(
}
}
randNum := rand.Intn(5)
if randNum < 2 {
if randNum < 0 {
parquetPossible = false
}
if parquetPossible {
Expand Down

0 comments on commit 1332113

Please sign in to comment.