Skip to content

Commit

Permalink
[#23240] CDCSDK: Make test replicationConnectionConsumptionAllDataTyp…
Browse files Browse the repository at this point in the history
…es more resilient

Summary:
In the tests `TestPgReplicationSlot#replicationConnectionConsumptionAllDataTypesWithYbOutput` and `TestPgReplicationSlot#replicationConnectionConsumptionAllDataTypesWithPgOutput` we create a table with dynamic types. This means that the typeoid of such types is allocated at runtime. The tests assert on the relation message to check the type_oid of every column. This makes the tests fragile as any change in the Oids allotment will cause the test to fail.

This diff makes these tests more robust by skipping the type_oid assertions for dynamic types.
Jira: DB-12173

Test Plan: Jenkins: .*TestPgReplicationSlot.*

Reviewers: siddharth.shah, stiwary

Reviewed By: siddharth.shah

Subscribers: ycdcxcluster

Tags: #jenkins-ready

Differential Revision: https://phorge.dev.yugabyte.com/D36763
  • Loading branch information
Sumukh-Phalgaonkar committed Jul 23, 2024
1 parent b0349fe commit fe37ffd
Showing 1 changed file with 12 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1010,11 +1010,14 @@ void replicationConnectionConsumptionAllDataTypes(String pluginName) throws Exce
PgOutputRelationMessageColumn.CreateForComparison("col_tstzrange", 3910),
PgOutputRelationMessageColumn.CreateForComparison("col_daterange", 3912),
// The Oids for columns below are not fixed. Changing the order of creation of
// objects (extensions, tables etc.) in the test will these Oids.
PgOutputRelationMessageColumn.CreateForComparison("col_hstore", 16385),
// objects (extensions, tables etc.) in the test will change these Oids. Hence,
// skip comparing the Oids of these types.
PgOutputRelationMessageColumn.CreateForComparison(
"col_hstore", 16385, /* compareDataType */ false),
PgOutputRelationMessageColumn.CreateForComparison(
"col_discount", 16518, /* compareDataType */ false),
PgOutputRelationMessageColumn.CreateForComparison("col_discount_array",16517))));
PgOutputRelationMessageColumn.CreateForComparison(
"col_discount_array", 16517, /* compareDataType */ false))));
} else {
// The replica identity for test_table in case of pgoutput is DEFAULT.
add(PgOutputRelationMessage.CreateForComparison("public", "test_table", 'd',
Expand Down Expand Up @@ -1054,11 +1057,14 @@ void replicationConnectionConsumptionAllDataTypes(String pluginName) throws Exce
PgOutputRelationMessageColumn.CreateForComparison("col_tstzrange", 3910),
PgOutputRelationMessageColumn.CreateForComparison("col_daterange", 3912),
// The Oids for columns below are not fixed. Changing the order of creation of
// objects (extensions, tables etc.) in the test will these Oids.
PgOutputRelationMessageColumn.CreateForComparison("col_hstore", 16385),
// objects (extensions, tables etc.) in the test will change these Oids. Hence,
// skip comparing the Oids of these types.
PgOutputRelationMessageColumn.CreateForComparison(
"col_hstore", 16385, /* compareDataType */ false),
PgOutputRelationMessageColumn.CreateForComparison(
"col_discount", 16518, /* compareDataType */ false),
PgOutputRelationMessageColumn.CreateForComparison("col_discount_array",16517))));
PgOutputRelationMessageColumn.CreateForComparison(
"col_discount_array", 16517, /* compareDataType */ false))));
}
add(PgOutputInsertMessage.CreateForComparison(new PgOutputMessageTuple((short) 38,
Arrays.asList(new PgOutputMessageTupleColumnValue("1"),
Expand Down

0 comments on commit fe37ffd

Please sign in to comment.