Skip to content

Commit d0f67a1

Browse files
committed
changefeedccl: opt out of db-level feed testing for offline table error
A previous patch allowed db-level changefeeds to not end with a terminal error when a watched table becomes offline. The existing test asserted that table-level changefeeds fail with that terminal error. Metamorphic testing caused these changefeeds to instead be changed to db-level, causing the test to fail when no terminal error occurred. This patch opts out from metamorphic db-level testing for the test that asserts that a table-level changefeed fails with a terminal error when encountering an offline table. Fixes: #159056 Release note: None
1 parent 0dfe683 commit d0f67a1

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

pkg/ccl/changefeedccl/changefeed_test.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5859,7 +5859,10 @@ func TestChangefeedFailOnTableOffline(t *testing.T) {
58595859
sqlDB.Exec(t, `CREATE TABLE for_import (a INT PRIMARY KEY, b INT) WITH (schema_locked=false)`)
58605860
defer sqlDB.Exec(t, `DROP TABLE for_import`)
58615861
sqlDB.Exec(t, `INSERT INTO for_import VALUES (0, NULL)`)
5862-
forImport := feed(t, f, `CREATE CHANGEFEED FOR for_import `)
5862+
forImport := feed(t, f, `CREATE CHANGEFEED FOR for_import `,
5863+
optOutOfMetamorphicDBLevelChangefeed{
5864+
reason: "DB level changefeeds do not fail with 'CHANGEFEED cannot target offline table' terminal error",
5865+
})
58635866
defer closeFeed(t, forImport)
58645867
assertPayloads(t, forImport, []string{
58655868
`for_import: [0]->{"after": {"a": 0, "b": null}}`,
@@ -5903,7 +5906,10 @@ func TestChangefeedFailOnTableOffline(t *testing.T) {
59035906
sqlDB.CheckQueryResultsRetry(t, "SELECT count(*) FROM for_import", [][]string{{"1"}})
59045907

59055908
// Changefeed should fail regardless
5906-
forImport := feed(t, f, `CREATE CHANGEFEED FOR for_import WITH cursor=$1`, start)
5909+
forImport := feed(t, f, `CREATE CHANGEFEED FOR for_import WITH cursor=$1`, start,
5910+
optOutOfMetamorphicDBLevelChangefeed{
5911+
reason: "DB level changefeeds do not fail with 'CHANGEFEED cannot target offline table' terminal error",
5912+
})
59075913
defer closeFeed(t, forImport)
59085914
requireTerminalErrorSoon(context.Background(), t, forImport,
59095915
regexp.MustCompile(`CHANGEFEED cannot target offline table: for_import \(offline reason: "importing"\)`))

0 commit comments

Comments
 (0)